From bc21f0ed338040497f1755331d5fc6a824a4de25 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 13 Aug 2015 14:05:10 +0200 Subject: Don't crash when current pic doesn't exist Check if the currently shown picture still exists instead of crashing. --- pictureviewer2.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp index d8cae44..6568128 100644 --- a/pictureviewer2.cpp +++ b/pictureviewer2.cpp @@ -460,6 +460,10 @@ void PictureViewer2::showFile(const PicData &file){ return; } mCurPicData = file; + QFileInfo fi(file.at(PicFilesModel::FullPath).toString()); + if(!fi.exists()){ + return; + } QPixmap pixmap(file.at(PicFilesModel::FullPath).toString()); if(pixmap.isNull()){ mCurPicData = Helper::convertToPng(file); -- cgit v1.2.3-70-g09d2