From 672265b564df2eaa448c440c6dc324fd1f78731d Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 1 Oct 2023 19:01:59 -0400 Subject: [PATCH] Give wxTheApp to python scripts that end up touching Pgm().App() Fixes KICAD-QG --- common/pgm_base.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 76a4b49a76..ecfbbcf220 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -174,7 +174,13 @@ void PGM_BASE::Destroy() wxApp& PGM_BASE::App() { - wxASSERT( wxTheApp ); + if( wxTheApp == nullptr ) + { + // This should only happen with python scripts + wxApp dummy; + return dummy; + } + return *wxTheApp; }