From 888050bd67819c8c3f46dfc4c9424a354b407db9 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 3 Nov 2021 16:52:46 -0700 Subject: [PATCH] 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 --- 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 e466769195..65e721b8f7 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -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();