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; }