Browse Source

protect against nullptr use (can happen when loading a schematic)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21767
master
jean-pierre charras 4 weeks ago
parent
commit
6acba9d2ba
  1. 3
      eeschema/sch_label.cpp

3
eeschema/sch_label.cpp

@ -939,7 +939,8 @@ bool SCH_LABEL_BASE::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* toke
}
else
{
if( aPath->Last()->ResolveTextVar( aPath, token, aDepth + 1 ) )
// aPath->Last() can be null when loading schematic, i.e. when all sheets are not yet loaded
if( aPath->Last() && aPath->Last()->ResolveTextVar( aPath, token, aDepth + 1 ) )
return true;
}

Loading…
Cancel
Save