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.
This commit is contained in:
Jim Broadus 2020-02-12 00:47:52 -08:00 committed by John Maguire
parent 415e4aa2ec
commit a5db937d23
1 changed files with 1 additions and 1 deletions

View File

@ -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;