From c71ce41c83771c9c17976225f25a41838b5603c7 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 21 Jul 2023 07:16:23 +0200 Subject: [PATCH] LastFMImport: Move variable declaration --- src/scrobbler/lastfmimport.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scrobbler/lastfmimport.cpp b/src/scrobbler/lastfmimport.cpp index 0102b52cf..1a4c8b20f 100644 --- a/src/scrobbler/lastfmimport.cpp +++ b/src/scrobbler/lastfmimport.cpp @@ -150,11 +150,10 @@ QByteArray LastFMImport::GetReplyData(QNetworkReply *reply) { data = reply->readAll(); QJsonParseError json_error; QJsonDocument json_doc = QJsonDocument::fromJson(data, &json_error); - int error_code = -1; if (json_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) { QJsonObject json_obj = json_doc.object(); if (json_obj.contains("error") && json_obj.contains("message")) { - error_code = json_obj["error"].toInt(); + int error_code = json_obj["error"].toInt(); QString error_message = json_obj["message"].toString(); error = QString("%1 (%2)").arg(error_message).arg(error_code); }