eeschema: fix a crash when converting a old .sch file containing global labels.

This commit is contained in:
jean-pierre charras 2022-12-04 21:06:16 +01:00
parent 6e1f075daa
commit 6b9c82c975
1 changed files with 7 additions and 3 deletions

View File

@ -346,6 +346,9 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences() const
else if( item->Type() == SCH_GLOBAL_LABEL_T )
{
SCH_GLOBALLABEL* label = static_cast<SCH_GLOBALLABEL*>( item );
if( label->GetFields().size() > 0 ) // Can be not the case when reading a old .sch schematic
{
SCH_FIELD& intersheetRefs = label->GetFields()[0];
intersheetRefs.SetVisible( label->Schematic()->Settings().m_IntersheetRefsShow );
@ -353,6 +356,7 @@ void SCH_SHEET_PATH::UpdateAllScreenReferences() const
}
}
}
}