Avoid null pin assertions

When changing units, we might not have the original pins
available to set the Alt assignments.  Instead, we search
by number and skip the pin if it doesn't exist in the
new unit

Fixes https://gitlab.com/kicad/code/kicad/issues/12218
This commit is contained in:
Seth Hillbrand 2022-08-12 18:24:07 -07:00
parent 488a53e71b
commit d142cf239e
1 changed files with 4 additions and 2 deletions

View File

@ -712,7 +712,9 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
for( const SCH_PIN& model_pin : *m_dataModel )
{
// map from the edited copy back to the "real" pin in the symbol.
SCH_PIN* src_pin = m_symbol->GetPin( model_pin.GetLibPin() );
SCH_PIN* src_pin = m_symbol->GetPin( model_pin.GetNumber() );
if( src_pin )
src_pin->SetAlt( model_pin.GetAlt() );
}
}