From 0f4bd34bce438d499098837aa26814f5c33962f2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 27 Jul 2023 15:12:41 +0200 Subject: [PATCH] Eeschema: Export symbols to New Library: Fix Cancel button not working This bug can crash Eeschema. Fixes #15278 https://gitlab.com/kicad/code/kicad/-/issues/15278 --- eeschema/tools/sch_editor_control.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 59953d50b6..caef36d9eb 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -368,6 +368,9 @@ int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent ) wxFileName fn; SYMBOL_LIB_TABLE* libTable = m_frame->SelectSymLibTable(); + if( !libTable ) // Cancelled by user + return 0; + if( !m_frame->LibraryFileBrowser( false, fn, KiCadSymbolLibFileWildcard(), KiCadSymbolLibFileExtension, false, ( libTable == &SYMBOL_LIB_TABLE::GetGlobalLibTable() ),