mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
changed return-value of errors to false
This commit is contained in:
parent
7288c5a0b6
commit
1d2e56f19d
1 changed files with 4 additions and 4 deletions
|
@ -21,18 +21,18 @@ void TwitchApi::findUserId(const QString user, std::function<void(QString)> succ
|
|||
if (!root.value("users").isArray()) {
|
||||
Log("API Error while getting user id, users is not an array");
|
||||
successCallback("");
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
auto users = root.value("users").toArray();
|
||||
if (users.size() != 1) {
|
||||
Log("API Error while getting user id, users array size is not 1");
|
||||
successCallback("");
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
if (!users[0].isObject()) {
|
||||
Log("API Error while getting user id, first user is not an object");
|
||||
successCallback("");
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
auto firstUser = users[0].toObject();
|
||||
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 "
|
||||
"string");
|
||||
successCallback("");
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
successCallback(id.toString());
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue