[Run-Plugin][Program] Fix null reference exception on Dispose (#11785)

This commit is contained in:
Mykhailo Pylyp 2021-06-18 13:40:10 +03:00 committed by GitHub
parent 6c61f5ddec
commit 9836c19dd5

View file

@ -169,7 +169,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings
return; return;
} }
if (!(_context is null)) if (_context != null && _context.API != null)
{ {
_context.API.ThemeChanged -= OnThemeChanged; _context.API.ThemeChanged -= OnThemeChanged;
} }