summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-05-11 18:15:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-05-11 18:15:01 +0300
commit9e5b824d6981312015f69d3da7b0f11f44492976 (patch)
tree331395dd2d4dba484a72401ddd17ef543208d659 /protocols/Discord/src
parent289f73c0c5d58c083c02c7c5b12427ebb8147625 (diff)
crash fix for Discord, if server required a captcha
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/server.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index 0c8f31bf5b..eef014b3fa 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -280,8 +280,10 @@ void CDiscordProto::OnReceiveToken(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*)
JSONNode root = JSONNode::parse(pReply->pData);
if (root) {
const JSONNode &captcha = root["captcha_key"].as_array();
- if (captcha && captcha.begin()[0].as_mstring() == "captcha-required") {
- debugLogA("captcha required");
+ if (captcha) {
+ for (auto& it : captcha)
+ if (it.as_mstring() == "captcha-required")
+ debugLogA("captcha required");
}
}
ConnectionFailed(LOGINERR_WRONGPASSWORD);