From 0d03f2febc2b0769805a66f000a7e10ee1ffcd9a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 1 Mar 2024 18:48:14 +0000 Subject: [PATCH] When failing to import, ensure extant screen We need at least the root screen in order to handle any action in Eeschema. Because this is destroyed by starting to load the new schematic, when failing, we need to reset to null. This is not as good as resetting to the previous state but that will take refactoring our file load routines in schematic editor Fixes https://gitlab.com/kicad/code/kicad/-/issues/16993 --- eeschema/files-io.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index cbb9d9a388..2c37dd15f6 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -777,6 +777,8 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent ) if( pluginType == SCH_IO_MGR::SCH_FILE_T::SCH_FILE_UNKNOWN ) { wxLogError( _( "No loader can read the specified file: '%s'." ), fn.GetFullPath() ); + CreateScreens(); + SetScreen( Schematic().RootScreen() ); return; }