From 34133589921d65c1869ce4062949e609f0f7744a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 27 Sep 2021 22:56:36 +0100 Subject: [PATCH] Make sure there is a filename before creating a parameter for it. Fixes https://gitlab.com/kicad/code/kicad/issues/9263 --- common/gestfich.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/gestfich.cpp b/common/gestfich.cpp index 68e00ef324..7b8ab266c6 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -139,10 +139,12 @@ int ExecuteFile( const wxString& aEditorName, const wxString& aFileName, wxProce if( !param.IsEmpty() ) args[i++] = param.wc_str(); - args[i++] = aFileName.wc_str(); + if( !aFileName.IsEmpty() ) + args[i++] = aFileName.wc_str(); + args[i] = nullptr; - return wxExecute( const_cast( args ), wxEXEC_ASYNC, aCallback ); + return wxExecute( const_cast< wchar_t**>( args ), wxEXEC_ASYNC, aCallback ); } wxString msg;