Skip to content

Commit

Permalink
Fix case empty fileToLoad string
Browse files Browse the repository at this point in the history
  • Loading branch information
zonkmachine committed Jan 29, 2016
1 parent 6cd15dc commit 2098e5d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,18 @@ int main( int argc, char * * argv )

// Test file argument before continuing
QFileInfo fileInfo( fileToLoad );
if ( !fileInfo.exists() || !fileInfo.isFile() )
if( !fileToLoad.isEmpty() )
{
printf("The file %s does not exist!\n", fileToLoad.toStdString().c_str());
exit( 1 );
}
else if( ! ( fileInfo.suffix() == "mmp" || fileInfo.suffix() == "mmpz" ) )
{
printf("%s is not an LMMS project file!\n", fileToLoad.toStdString().c_str());
exit( 1 );
if ( !fileInfo.exists() || !fileInfo.isFile() )
{
printf("The file %s does not exist!\n", fileToLoad.toStdString().c_str());
exit( 1 );
}
else if( ! ( fileInfo.suffix() == "mmp" || fileInfo.suffix() == "mmpz" ) )
{
printf("%s is not an LMMS project file!\n", fileToLoad.toStdString().c_str());
exit( 1 );
}
}

ConfigManager::inst()->loadConfigFile();
Expand Down

0 comments on commit 2098e5d

Please sign in to comment.