Check the existence of an input file that is to be rendered (#2262)

Added a check for the existence of the file that should be rendered from
the command line. LMMS now exits with an error message in case the file
does not exist.
This commit is contained in:
Michael Gregorius
2015-08-14 18:58:13 +02:00
parent 21ff5333dc
commit 4883c579a5

View File

@@ -575,6 +575,13 @@ int main( int argc, char * * argv )
{
Engine::init( true );
QFileInfo fileInfo( fileToLoad );
if ( !fileInfo.exists() )
{
printf("The file %s does not exist!\n", fileToLoad.toStdString().c_str());
exit( 1 );
}
printf( "Loading project...\n" );
Engine::getSong()->loadProject( fileToLoad );
printf( "Done\n" );