From 9e5b824d6981312015f69d3da7b0f11f44492976 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 11 May 2019 18:15:01 +0300 Subject: crash fix for Discord, if server required a captcha --- protocols/Discord/discord.vcxproj | 4 ---- protocols/Discord/src/server.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'protocols/Discord') diff --git a/protocols/Discord/discord.vcxproj b/protocols/Discord/discord.vcxproj index ab81bd4bb4..44e21b16ef 100644 --- a/protocols/Discord/discord.vcxproj +++ b/protocols/Discord/discord.vcxproj @@ -36,8 +36,4 @@ {f6a9340e-b8d9-4c75-be30-47dc66d0abc7} - - - - \ No newline at end of file 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); -- cgit v1.2.3