Make sure list has items before dereferening.

Fixes https://gitlab.com/kicad/code/kicad/issues/12267
This commit is contained in:
Jeff Young 2022-09-01 00:20:53 +01:00
parent 42efaff045
commit 9a961d60d5
1 changed files with 3 additions and 3 deletions

View File

@ -639,9 +639,9 @@ bool SYMBOL_VIEWER_FRAME::ReCreateLibList()
}
else
{
// If not found, clear current library selection because it can be
// deleted after a config change.
m_libraryName = m_libList->GetBaseString( 0 );
// If not found, clear current library selection because it can be deleted after a
// config change.
m_libraryName = m_libList->GetCount() > 0 ? m_libList->GetBaseString( 0 ) : wxT( "" );
m_entryName = wxEmptyString;
m_unit = 1;
m_convert = LIB_ITEM::LIB_CONVERT::BASE;