A BOARD may not always have a project

For example, if it's the footprint editor model

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15283


(cherry picked from commit 2459949d0d)
This commit is contained in:
Jon Evans 2023-08-01 17:19:13 -04:00
parent 7fb15269d1
commit 04bb3dfe9d
1 changed files with 5 additions and 2 deletions

View File

@ -367,8 +367,11 @@ void BOARD::GetContextualTextVars( wxArrayString* aVars ) const
GetTitleBlock().GetContextualTextVars( aVars );
for( std::pair<wxString, wxString> entry : GetProject()->GetTextVars() )
add( entry.first );
if( GetProject() )
{
for( std::pair<wxString, wxString> entry : GetProject()->GetTextVars() )
add( entry.first );
}
}