From eb06ecab10d34360d990052e8fc812d808661f4d Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 28 Feb 2022 12:26:18 -0800 Subject: [PATCH] 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 (cherry picked from commit 63b06af6b13772aa55b3dd2fe8bba6c99930a5e4) --- eeschema/sch_sheet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index e38017242d..aa08c18763 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -248,7 +248,9 @@ bool SCH_SHEET::ResolveTextVar( wxString* token, int aDepth ) const 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; }