diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-30 20:10:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-30 20:10:34 +0000 |
commit | 5fb83b846dea3fd368aae4b8f8180f1f2bb4065c (patch) | |
tree | a041f62add1a7d232124d642fec633968c2bb1ee /protocols | |
parent | 5851536bf2c79d9c7a7ffb4edb69b6a0f6305f9f (diff) |
fix for a wrong status switching in SkypeWeb
git-svn-id: http://svn.miranda-ng.org/main/trunk@13912 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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");
|