summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rosca <[email protected]>2017-04-16 17:40:50 +0200
committerDavid Rosca <[email protected]>2017-04-16 17:51:45 +0200
commitbd07284ec84af57cefd0c91339656f0bda79e466 (patch)
treebba21d0c963c9ed498a4a46303f5c2e19ee7d021
parent3c80fe5fa6b008d97a46e091d4fe1bd63f457f17 (diff)
Fix crash in JSON traversal in Bing potd provider
QJsonArray::operator[] returns QJsonValueRef which seems to crash when trying to convert to object. Using QJsonArray::at() instead which returns QJsonValue fixes the crash. BUG: 378590 Differential Revision: https://phabricator.kde.org/D5478
-rw-r--r--dataengines/potd/bingprovider.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/dataengines/potd/bingprovider.cpp b/dataengines/potd/bingprovider.cpp
index a2a2f8f..83a4129 100644
--- a/dataengines/potd/bingprovider.cpp
+++ b/dataengines/potd/bingprovider.cpp
@@ -60,7 +60,7 @@ void BingProvider::Private::pageRequestFinished(KJob* _job)
if (!imagesArray.isArray() || imagesArray.toArray().size() <= 0) {
break;
}
- auto imageObj = imagesArray.toArray()[0];
+ auto imageObj = imagesArray.toArray().at(0);
if (!imageObj.isObject()) {
break;
}