diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index a2a2dd9d75..c34f2a8839 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -332,21 +332,24 @@ void SETTINGS_MANAGER::SaveColorSettings( COLOR_SETTINGS* aSettings, const std:: if( !aSettings->Store() ) { wxLogTrace( traceSettings, "Color scheme %s not modified; skipping save", - aSettings->GetFilename(), aNamespace ); + aNamespace ); return; } wxASSERT( aSettings->Contains( aNamespace ) ); - wxLogTrace( traceSettings, "Saving color scheme %s, preserving %s", aSettings->GetFilename(), + wxLogTrace( traceSettings, "Saving color scheme %s, preserving %s", + aSettings->GetFilename(), aNamespace ); - nlohmann::json backup = aSettings->At( aNamespace ); + OPT backup = aSettings->GetJson( aNamespace ); wxString path = GetColorSettingsPath(); aSettings->LoadFromFile( path ); - ( *aSettings->Internals() )[aNamespace].update( backup ); + if( backup ) + ( *aSettings->Internals() )[aNamespace].update( *backup ); + aSettings->Load(); aSettings->SaveToFile( path, true );