diff options
author | Arno <arno@disconnect.de> | 2015-08-13 14:05:10 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2015-08-13 14:05:10 +0200 |
commit | bc21f0ed338040497f1755331d5fc6a824a4de25 (patch) | |
tree | 003168fc280a7e2ade46356b57c12bebf69e7714 | |
parent | e223bc238ea3e2dbeaabcc4c9218558d26273de5 (diff) | |
download | SheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.tar.gz SheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.tar.bz2 SheMov-bc21f0ed338040497f1755331d5fc6a824a4de25.zip |
Don't crash when current pic doesn't exist
Check if the currently shown picture still exists instead of crashing.
-rw-r--r-- | pictureviewer2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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); |