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:
parent
488a53e71b
commit
d142cf239e
|
@ -712,7 +712,9 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
||||||
for( const SCH_PIN& model_pin : *m_dataModel )
|
for( const SCH_PIN& model_pin : *m_dataModel )
|
||||||
{
|
{
|
||||||
// map from the edited copy back to the "real" pin in the symbol.
|
// 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() );
|
src_pin->SetAlt( model_pin.GetAlt() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue