mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
Make sure m_callback is not null before using it (#541)
This commit is contained in:
parent
70f40e207a
commit
8f8f4506ff
@ -92,7 +92,10 @@ IFACEMETHODIMP_(void) FancyZonesSettings::SetConfig(PCWSTR config) noexcept try
|
||||
{
|
||||
LoadSettings(config, false /*fromFile*/);
|
||||
SaveSettings();
|
||||
m_callback->SettingsChanged();
|
||||
if (m_callback)
|
||||
{
|
||||
m_callback->SettingsChanged();
|
||||
}
|
||||
Trace::SettingsChanged(m_settings);
|
||||
}
|
||||
CATCH_LOG();
|
||||
@ -103,7 +106,7 @@ IFACEMETHODIMP_(void) FancyZonesSettings::CallCustomAction(PCWSTR action) noexce
|
||||
PowerToysSettings::CustomActionObject action_object =
|
||||
PowerToysSettings::CustomActionObject::from_json_string(action);
|
||||
|
||||
if (action_object.get_name() == L"ToggledFZEditor")
|
||||
if (m_callback && action_object.get_name() == L"ToggledFZEditor")
|
||||
{
|
||||
m_callback->ToggleEditor();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user