From db382f8782d3d210527b0f02b2c0a8ec4b68c992 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 71977e8fbf..4df9056c33 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -371,6 +371,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() ),