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:
jean-pierre charras 2024-02-11 21:03:00 +01:00
parent d6fb362bd1
commit fe1579ebbd
1 changed files with 9 additions and 1 deletions

View File

@ -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.
if( ( m_replaceFootprints || ( aPcbFootprint->GetAttributes() & FP_JUST_ADDED ) )
&& !m_isDryRun )
{
// Update FOOTPRINT_FIELD (if exists in the netlist)
try
{
aPcbFootprint->Footprint().SetText(
aNetlistComponent->GetFields()[GetCanonicalFieldName( FOOTPRINT_FIELD )] );
}
catch( ... )
{
// If not exist (old netlist), just skip it: What else?
}
}
// Test for time stamp change.
KIID_PATH new_path = aNetlistComponent->GetPath();