aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r--qt-ui/divepicturewidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp
index ce997fea1..8c1cb3571 100644
--- a/qt-ui/divepicturewidget.cpp
+++ b/qt-ui/divepicturewidget.cpp
@@ -63,6 +63,10 @@ void ImageDownloader::load(){
void ImageDownloader::saveImage(QNetworkReply *reply)
{
QByteArray imageData = reply->readAll();
+ QImage image = QImage();
+ image.loadFromData(imageData);
+ if (image.isNull())
+ return;
QCryptographicHash hash(QCryptographicHash::Sha1);
hash.addData(imageData);
QString path = QStandardPaths::standardLocations(QStandardPaths::CacheLocation).first();