From 4883c579a5119bdf0f25440968ee1cb9e8ff5d9c Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Fri, 14 Aug 2015 18:58:13 +0200 Subject: [PATCH] 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. --- src/core/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/main.cpp b/src/core/main.cpp index 1f1e3095c..8b5a3ffb5 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -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" );