changed return-value of errors to false

This commit is contained in:
apa420 2018-07-12 11:11:21 +02:00
parent 7288c5a0b6
commit 1d2e56f19d

View file

@ -21,18 +21,18 @@ void TwitchApi::findUserId(const QString user, std::function<void(QString)> succ
if (!root.value("users").isArray()) { if (!root.value("users").isArray()) {
Log("API Error while getting user id, users is not an array"); Log("API Error while getting user id, users is not an array");
successCallback(""); successCallback("");
return true; return false;
} }
auto users = root.value("users").toArray(); auto users = root.value("users").toArray();
if (users.size() != 1) { if (users.size() != 1) {
Log("API Error while getting user id, users array size is not 1"); Log("API Error while getting user id, users array size is not 1");
successCallback(""); successCallback("");
return true; return false;
} }
if (!users[0].isObject()) { if (!users[0].isObject()) {
Log("API Error while getting user id, first user is not an object"); Log("API Error while getting user id, first user is not an object");
successCallback(""); successCallback("");
return true; return false;
} }
auto firstUser = users[0].toObject(); auto firstUser = users[0].toObject();
auto id = firstUser.value("_id"); auto id = firstUser.value("_id");
@ -40,7 +40,7 @@ void TwitchApi::findUserId(const QString user, std::function<void(QString)> succ
Log("API Error: while getting user id, first user object `_id` key is not a " Log("API Error: while getting user id, first user object `_id` key is not a "
"string"); "string");
successCallback(""); successCallback("");
return true; return false;
} }
successCallback(id.toString()); successCallback(id.toString());
return true; return true;