1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-30 17:14:58 +01:00

Subsonic: Remove redundant null check

This commit is contained in:
Jonas Kvinge 2021-09-21 01:36:38 +02:00
parent f4f005cdd6
commit f74f2ca3ef
2 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ QJsonObject SubsonicBaseRequest::ExtractJsonObj(QByteArray &data) {
return QJsonObject(); return QJsonObject();
} }
if (json_doc.isNull() || json_doc.isEmpty()) { if (json_doc.isEmpty()) {
Error("Received empty Json document.", data); Error("Received empty Json document.", data);
return QJsonObject(); return QJsonObject();
} }

View File

@ -272,7 +272,7 @@ void SubsonicService::HandlePingReply(QNetworkReply *reply, const QUrl &url, con
QByteArray data = reply->readAll(); QByteArray data = reply->readAll();
QJsonParseError parse_error; QJsonParseError parse_error;
QJsonDocument json_doc = QJsonDocument::fromJson(data, &parse_error); QJsonDocument json_doc = QJsonDocument::fromJson(data, &parse_error);
if (parse_error.error == QJsonParseError::NoError && !json_doc.isNull() && !json_doc.isEmpty() && json_doc.isObject()) { if (parse_error.error == QJsonParseError::NoError && !json_doc.isEmpty() && json_doc.isObject()) {
QJsonObject json_obj = json_doc.object(); QJsonObject json_obj = json_doc.object();
if (!json_obj.isEmpty() && json_obj.contains("error")) { if (!json_obj.isEmpty() && json_obj.contains("error")) {
QJsonValue json_error = json_obj["error"]; QJsonValue json_error = json_obj["error"];