xamarin / Xamarin.PropertyEditing

MIT License
24 stars 16 forks source link

Protect against CurrentAppearance NRE #789

Closed BretJohnson closed 2 years ago

BretJohnson commented 2 years ago

Fix AB#1468252

Apparently there are scenarios where CurrentAppearance is not set by the client on HostResourceProvider (UITools sets it but vsmac doesn't currently) nor is NSAppearance.CurrentAppearance set on the current thread (perhaps the thread is newly created and AppKit didn't get a chance to set it), causing bug 1468252.

To protect against that, we check if both are null and in that case just assume it's light theme rather than generate an NRE.

BretJohnson commented 2 years ago

@gitbot backport d17-0-vsmac

vs-mobiletools-engineering-service2 commented 2 years ago

Backport Job to branch d17-0-vsmac Created! The magic is happening here

vs-mobiletools-engineering-service2 commented 2 years ago

Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5718908 for more details.