From 5fb83b846dea3fd368aae4b8f8180f1f2bb4065c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 May 2015 20:10:34 +0000 Subject: fix for a wrong status switching in SkypeWeb git-svn-id: http://svn.miranda-ng.org/main/trunk@13912 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_login.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 54abba1078..f814a4a56d 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -240,7 +240,7 @@ void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response) } JSONNode json = JSONNode::parse(response->pData); - if (json == NULL) + if (!json) { debugLogA(__FUNCTION__ ": failed to change status"); ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN); @@ -248,7 +248,13 @@ void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response) return; } - int iNewStatus = SkypeToMirandaStatus(json["status"].as_string().c_str()); + const JSONNode &nStatus = json["status"]; + if (!nStatus) { + debugLogA(__FUNCTION__ ": result contains no valid status to switch to"); + return; + } + + int iNewStatus = SkypeToMirandaStatus(nStatus.as_string().c_str()); if (iNewStatus == ID_STATUS_OFFLINE) { debugLogA(__FUNCTION__ ": failed to change status"); -- cgit v1.2.3