From 65ac68bb0bcc8d971784a06b92482db24dcb7d2d Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 17 Sep 2019 14:20:43 +1000 Subject: [PATCH] Avoid qt warning on project load when thumbnail doesn't exist --- src/app/qgisapp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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