Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Oct 6, 2024
1 parent b8bf8da commit ce742e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/serverlistquerier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,12 @@ std::optional<QStringList> ServerListQuerier::parseJson(const QByteArray &data)
QJsonObject providerObj = providerValue.toObject();
auto jidIt = providerObj.find("jid");

if (jidIt == providerObj.end() || !jidIt->isString()) {
QString jid;
if (jidIt == providerObj.end() || !jidIt->isString() || (jid = jidIt->toString()).isEmpty()) {
parsingErrorOccurred = true;
continue; // Skip if "jid" is not found or is not a string
}

QString jid = jidIt->toString();
if (!jid.isEmpty()) {
jidList.append(jid);
} else {
parsingErrorOccurred = true; // Handle empty jid case
}
jidList.append(jid);
}

// Emit an error if the list is empty and there was a parsing error
Expand Down
2 changes: 2 additions & 0 deletions src/serverlistquerier.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <QObject>
#include <QUrl>

#include <optional>

class QNetworkAccessManager;

class ServerListQuerier : public QObject {
Expand Down

0 comments on commit ce742e6

Please sign in to comment.