xamarin / Xamarin.PropertyEditing

MIT License
24 stars 16 forks source link

[d17-0-vsmac] Protect against CurrentAppearance NRE #790

Closed vs-mobiletools-engineering-service2 closed 2 years ago

vs-mobiletools-engineering-service2 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.

Backport of #789