7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 08:41:41 +00:00

Fix crash in symbol editor GetlibraryNames

GetLibrary is allowed to return null, so we need to check before
dereferencing

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19236

(cherry picked from commit 5552d63f70)
This commit is contained in:
Seth Hillbrand 2024-12-02 17:16:18 -08:00
parent ce20689caf
commit d04a20b765

View File

@ -137,7 +137,9 @@ wxArrayString SYMBOL_LIBRARY_MANAGER::GetLibraryNames() const
for( const wxString& libName : symTable()->GetLogicalLibs() )
{
// Database libraries are hidden from the symbol editor at the moment
if( GetLibrary( libName )->SchLibType() == SCH_IO_MGR::SCH_DATABASE )
SYMBOL_LIB_TABLE_ROW* row = GetLibrary( libName );
if( !row || row->SchLibType() == SCH_IO_MGR::SCH_DATABASE )
continue;
res.Add( libName );