mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 14:41:42 +00:00
Correctly initialise mandatory fields array.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19819
This commit is contained in:
parent
96022ee169
commit
d209dddcc6
@ -138,6 +138,9 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
|
||||
|
||||
std::map<BOARD_ITEM*, BOARD_ITEM*> ptrMap;
|
||||
|
||||
for( int id : MANDATORY_FIELDS )
|
||||
m_fields.push_back( nullptr );
|
||||
|
||||
// Copy fields
|
||||
for( PCB_FIELD* field : aFootprint.m_fields )
|
||||
{
|
||||
@ -1074,7 +1077,9 @@ void FOOTPRINT::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode, bool aSkipConnectiv
|
||||
|
||||
if( field->IsMandatory() )
|
||||
{
|
||||
wxASSERT( m_fields[ field->GetId() ] == nullptr );
|
||||
wxASSERT( m_fields.size() >= MANDATORY_FIELD_COUNT
|
||||
&& m_fields[ field->GetId() ] == nullptr );
|
||||
|
||||
m_fields[ field->GetId() ] = field;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user