From 5e85d110ea53a944201c8f3bd57601e265d66e81 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 26 Jun 2015 12:43:08 +0000 Subject: SkypeWeb:potential crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@14395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_messages.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeWeb') 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 -- cgit v1.2.3