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
This commit is contained in:
jean-pierre charras 2023-07-27 15:12:41 +02:00
parent d2ec4834d9
commit db382f8782
1 changed files with 3 additions and 0 deletions

View File

@ -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() ),