Load the previous project if an empty string is the argument

Previously it would just not open any project at all. This
was a problem for some launchers, which would pass an empty string
when no file is passed by the user.

Fixes https://gitlab.com/kicad/code/kicad/issues/5055
This commit is contained in:
Ian McInerney 2020-08-08 16:28:56 +01:00
parent 90a17427ee
commit 226e5205c4
1 changed files with 3 additions and 3 deletions

View File

@ -138,10 +138,10 @@ bool PGM_KICAD::OnPgmInit()
wxString projToLoad;
if( App().argc > 1 )
{
projToLoad = App().argv[1];
}
else if( settings->m_OpenProjects.size() ) // Check that there was a file open.
// If no file was given as an argument, check that there was a file open.
if( projToLoad.IsEmpty() && settings->m_OpenProjects.size() )
{
wxString last_pro = settings->m_OpenProjects.front();
settings->m_OpenProjects.erase( settings->m_OpenProjects.begin() );