From a5db937d234b0a91e6da0af34327d7a7976eb680 Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Wed, 12 Feb 2020 00:47:52 -0800 Subject: [PATCH] Fix itunes search. Using the [] operator on a non-const QJsonObject inserts an item. The test for an error message was always positive. Use the contains method instead. --- src/internet/podcasts/itunessearchpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internet/podcasts/itunessearchpage.cpp b/src/internet/podcasts/itunessearchpage.cpp index 5be00f74d..ef4ab5573 100644 --- a/src/internet/podcasts/itunessearchpage.cpp +++ b/src/internet/podcasts/itunessearchpage.cpp @@ -88,7 +88,7 @@ void ITunesSearchPage::SearchFinished(QNetworkReply* reply) { QJsonObject json_data = json_document.object(); // Was there an error message in the JSON? - if (!json_data["errorMessage"].isUndefined()) { + if (json_data.contains("errorMessage")) { QMessageBox::warning(this, tr("Failed to fetch podcasts"), json_data["errorMessage"].toString()); return;