Fix an error when missing argc/argv data

Boost::unit_test is supposed to pass along data vals but seems to be
missing in our case.  This provides a fallback
This commit is contained in:
Seth Hillbrand 2021-11-03 16:52:46 -07:00
parent b022b314a4
commit 888050bd67
1 changed files with 7 additions and 1 deletions

View File

@ -202,7 +202,13 @@ const wxString PGM_BASE::AskUserForPreferredEditor( const wxString& aDefaultEdit
bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit )
{
wxString pgm_name = wxFileName( App().argv[0] ).GetName().Lower();
wxString pgm_name;
/// Should never happen but boost unit_test isn't playing nicely in some cases
if( App().argc == 0 )
pgm_name = wxT( "kicad" );
else
pgm_name = wxFileName( App().argv[0] ).GetName().Lower();
wxInitAllImageHandlers();