From 6a9b1876bf8ebeca398c9c57ef90e01c25a7ada6 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 4 Feb 2018 23:12:42 +0900 Subject: MediaThumbnailJob::parseReply: Do not ignore underlying errors --- jobs/mediathumbnailjob.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp index 261978ec..dda1cdb4 100644 --- a/jobs/mediathumbnailjob.cpp +++ b/jobs/mediathumbnailjob.cpp @@ -52,10 +52,12 @@ QImage MediaThumbnailJob::scaledThumbnail(QSize toSize) const BaseJob::Status MediaThumbnailJob::parseReply(QNetworkReply* reply) { - GetContentThumbnailJob::parseReply(reply); - if( !_thumbnail.loadFromData(content()->readAll()) ) - { - qCDebug(JOBS) << "MediaThumbnailJob: could not read image data"; - } - return Success; + auto result = GetContentThumbnailJob::parseReply(reply); + if (!result.good()) + return result; + + if( _thumbnail.loadFromData(content()->readAll()) ) + return Success; + + return { IncorrectResponseError, "Could not read image data" }; } -- cgit v1.2.3