From 04bb3dfe9da7ce53efc16dc579f8b58f286b97e1 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 1 Aug 2023 17:19:13 -0400 Subject: [PATCH] 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 2459949d0d9a096bc8706aaf4d29fd8d10c2cfe1) --- pcbnew/board.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 2dc4290167..cee26398b1 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -367,8 +367,11 @@ void BOARD::GetContextualTextVars( wxArrayString* aVars ) const GetTitleBlock().GetContextualTextVars( aVars ); - for( std::pair entry : GetProject()->GetTextVars() ) - add( entry.first ); + if( GetProject() ) + { + for( std::pair entry : GetProject()->GetTextVars() ) + add( entry.first ); + } }