BOARD_NETLIST_UPDATER: fix issue when reading net-lists having no FOOTPRINT_FIELD
they can be old net-lists or non Kicad net-lists. Fixes #16931 https://gitlab.com/kicad/code/kicad/-/issues/16931
This commit is contained in:
parent
d6fb362bd1
commit
fe1579ebbd
|
@ -319,10 +319,18 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
|
||||||
// its own message if the footprint is changed, so we just set the field here.
|
// its own message if the footprint is changed, so we just set the field here.
|
||||||
if( ( m_replaceFootprints || ( aPcbFootprint->GetAttributes() & FP_JUST_ADDED ) )
|
if( ( m_replaceFootprints || ( aPcbFootprint->GetAttributes() & FP_JUST_ADDED ) )
|
||||||
&& !m_isDryRun )
|
&& !m_isDryRun )
|
||||||
|
{
|
||||||
|
// Update FOOTPRINT_FIELD (if exists in the netlist)
|
||||||
|
try
|
||||||
{
|
{
|
||||||
aPcbFootprint->Footprint().SetText(
|
aPcbFootprint->Footprint().SetText(
|
||||||
aNetlistComponent->GetFields()[GetCanonicalFieldName( FOOTPRINT_FIELD )] );
|
aNetlistComponent->GetFields()[GetCanonicalFieldName( FOOTPRINT_FIELD )] );
|
||||||
}
|
}
|
||||||
|
catch( ... )
|
||||||
|
{
|
||||||
|
// If not exist (old netlist), just skip it: What else?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Test for time stamp change.
|
// Test for time stamp change.
|
||||||
KIID_PATH new_path = aNetlistComponent->GetPath();
|
KIID_PATH new_path = aNetlistComponent->GetPath();
|
||||||
|
|
Loading…
Reference in New Issue