Avoid nullptr dereference when loading group info

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


(cherry picked from commit 9e7b4b7f89)
This commit is contained in:
Jon Evans 2024-02-27 19:43:21 -05:00
parent 12dcdc8bbe
commit e383c67e7f
1 changed files with 2 additions and 2 deletions

View File

@ -1241,14 +1241,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;