Avoid nullptr dereference when loading group info

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17154
This commit is contained in:
Jon Evans 2024-02-27 19:43:21 -05:00
parent 299b548a41
commit 9e7b4b7f89
1 changed files with 2 additions and 2 deletions

View File

@ -1257,14 +1257,14 @@ void PCB_IO_KICAD_SEXPR_PARSER::resolveGroups( BOARD_ITEM* aParent )
{
for( const KIID& aUuid : groupInfo->memberUuids )
{
BOARD_ITEM* item;
BOARD_ITEM* item = nullptr;
if( m_appendToExisting )
item = getItem( m_resetKIIDMap[ aUuid.AsString() ] );
else
item = getItem( aUuid );
if( item->Type() == NOT_USED )
if( !item || item->Type() == NOT_USED )
{
// This is the deleted item singleton, which means we didn't find the uuid.
continue;