Fix eeschema crash when updating fields from libraries, and when a symbol in schematic is not found in libs

Fixes: lp:1779722
https://bugs.launchpad.net/kicad/+bug/1779722
This commit is contained in:
jean-pierre charras 2018-07-02 21:02:27 +02:00
parent 520c6116f5
commit 3df27430c7
1 changed files with 4 additions and 0 deletions

View File

@ -135,6 +135,10 @@ void DIALOG_UPDATE_FIELDS::updateFields( SCH_COMPONENT* aComponent )
SCH_FIELDS newFields; SCH_FIELDS newFields;
PART_SPTR libPart = aComponent->GetPartRef().lock(); PART_SPTR libPart = aComponent->GetPartRef().lock();
if( libPart == nullptr ) // the symbol is not found in lib: cannot update fields
return;
aComponent->GetFields( oldFields, false ); aComponent->GetFields( oldFields, false );
for( auto compField : oldFields ) for( auto compField : oldFields )