From d6be0be1779392d66884a6e4a5019de7dfed7670 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 7 Sep 2020 11:43:12 -0400 Subject: [PATCH] Skip migration if target key is missing Fixes https://gitlab.com/kicad/code/kicad/-/issues/5536 --- pcbnew/footprint_editor_settings.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 7dc7868a34..8746e4028f 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -422,13 +422,16 @@ bool FOOTPRINT_EDITOR_SETTINGS::migrateSchema0to1() if( !m_manager ) { - wxLogTrace( - traceSettings, "Error: FOOTPRINT_EDITOR_SETTINGS migration cannot run unmanaged!" ); + wxLogTrace( traceSettings, + "Error: FOOTPRINT_EDITOR_SETTINGS migration cannot run unmanaged!" ); return false; } nlohmann::json::json_pointer theme_ptr( "/appearance/color_theme" ); + if( !count( theme_ptr ) ) + return true; + wxString selected = at( theme_ptr ).get(); wxString search = selected + wxT( "_footprints" ); @@ -437,7 +440,7 @@ bool FOOTPRINT_EDITOR_SETTINGS::migrateSchema0to1() if( settings->GetFilename() == search ) { wxLogTrace( traceSettings, "Updating footprint editor theme from %s to %s", - selected, search ); + selected, search ); ( *this )[theme_ptr] = search; return true; }