diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index a2456ec2773..36f765d225a 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -4508,7 +4508,9 @@ void QgisApp::saveRecentProjectPath( bool savePreviewImage ) // And remove the associated image while ( static_cast< uint >( mRecentProjects.count() ) > maxProjects + pinnedCount ) { - QFile( mRecentProjects.takeLast().previewImagePath ).remove(); + const QString previewImagePath = mRecentProjects.takeLast().previewImagePath; + if ( QFileInfo::exists( previewImagePath ) ) + QFile( mRecentProjects.takeLast().previewImagePath ).remove(); } // Persist the list