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:
parent
12dcdc8bbe
commit
e383c67e7f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue