diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-26 12:43:08 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-26 12:43:08 +0000 |
commit | 5e85d110ea53a944201c8f3bd57601e265d66e81 (patch) | |
tree | 5308cc25025c682f30fa4b8393baed5228947bfb | |
parent | ff9a272f224161a0559b8f9bd7b7964478ee616e (diff) |
SkypeWeb:potential crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@14395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 6964784fde..a17e1cdd67 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -90,19 +90,22 @@ void CSkypeProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) HANDLE hMessage = (HANDLE)param->hMessage;
delete param;
- if (response == NULL || (response->resultCode != 200 && response->resultCode != 201))
+ if (response == NULL || response->resultCode != 201)
{
std::string error("Unknown error");
- if (response->pData != NULL)
+ if (response && response->pData != NULL)
{
JSONNode root = JSONNode::parse(response->pData);
const JSONNode &node = root["errorCode"];
- error = node.isnull() ? "" : node.as_string();
+ if (!node.isnull())
+ error = node.as_string();
}
ptrT username(getTStringA(hContact, "Skypename"));
debugLogA(__FUNCTION__": failed to send message for %s (%s)", username, error.c_str());
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, hMessage, (LPARAM)error.c_str());
}
+
+
}
// preparing message/action to writing into db
|