Avoid resolving text vars without screen

We need to keep the screen blank while initially loading a sheet before
the hierarchy is developed.  Avoid resolving text variables during this
process

Fixes https://gitlab.com/kicad/code/kicad/issues/11000
This commit is contained in:
Seth Hillbrand 2022-02-28 12:26:18 -08:00
parent e5a85b107f
commit 63b06af6b1
1 changed files with 3 additions and 1 deletions

View File

@ -248,7 +248,9 @@ bool SCH_SHEET::ResolveTextVar( wxString* token, int aDepth ) const
PROJECT *project = &Schematic()->Prj(); PROJECT *project = &Schematic()->Prj();
if( m_screen->GetTitleBlock().TextVarResolver( token, project ) ) // We cannot resolve text variables initially on load as we need to first load the screen and
// then parse the hierarchy. So skip the resolution if the screen isn't set yet
if( m_screen && m_screen->GetTitleBlock().TextVarResolver( token, project ) )
{ {
return true; return true;
} }