Give wxTheApp to python scripts that end up touching Pgm().App()

Fixes KICAD-QG
This commit is contained in:
Marek Roszko 2023-10-01 19:01:59 -04:00
parent 3a567a3ae1
commit 672265b564
1 changed files with 7 additions and 1 deletions

View File

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