Defensive coding.

Fixes https://gitlab.com/kicad/code/kicad/issues/8790
This commit is contained in:
Jeff Young 2021-08-12 21:34:48 +01:00
parent d9cf939ba1
commit 98d0ce00ee
1 changed files with 4 additions and 1 deletions

View File

@ -168,8 +168,11 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
newGroup->GetItems().clear(); newGroup->GetItems().clear();
for( BOARD_ITEM* member : group->GetItems() ) for( BOARD_ITEM* member : group->GetItems() )
{
if( ptrMap.count( member ) )
newGroup->AddItem( ptrMap[ member ] ); newGroup->AddItem( ptrMap[ member ] );
} }
}
// Copy auxiliary data: 3D_Drawings info // Copy auxiliary data: 3D_Drawings info
m_3D_Drawings = aFootprint.m_3D_Drawings; m_3D_Drawings = aFootprint.m_3D_Drawings;