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 2451cbddec
commit 0f4bd34bce
1 changed files with 3 additions and 0 deletions

View File

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