summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-11 21:31:25 +0200
committerGeorge Hazan <ghazan@miranda.im>2019-01-11 21:31:25 +0200
commit933a54191bedc48943fe148909478e9dab549503 (patch)
tree75b26d99d0843889ec0c967e81df3d41dcaf41af /protocols
parent22a5482065a5803416aafdb933bd8bc62cf78b6e (diff)
crash fix
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Icq10/src/server.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp
index 65a3edda89..6033b73b14 100644
--- a/protocols/Icq10/src/server.cpp
+++ b/protocols/Icq10/src/server.cpp
@@ -122,6 +122,9 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact)
CMStringW wszChatName(buddy["friendly"].as_mstring());
SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszChatId, wszChatName);
+ if (si == nullptr)
+ return INVALID_CONTACT_ID;
+
Chat_AddGroup(si, TranslateT("admin"));
Chat_AddGroup(si, TranslateT("member"));
Chat_Control(m_szModuleName, wszChatId, m_bHideGroupchats ? WINDOW_HIDDEN : SESSION_INITDONE);
@@ -643,6 +646,9 @@ void CIcqProto::ProcessBuddyList(const JSONNode &ev)
for (auto &buddy : it["buddies"]) {
MCONTACT hContact = ParseBuddyInfo(buddy);
+ if (hContact == INVALID_CONTACT_ID)
+ continue;
+
if (db_get_sm(hContact, "CList", "Group").IsEmpty()) {
if (!bCreated) {
Clist_GroupCreate(0, szGroup);
@@ -672,6 +678,9 @@ void CIcqProto::ProcessDiff(const JSONNode &ev)
for (auto &buddy : it["buddies"]) {
MCONTACT hContact = ParseBuddyInfo(buddy);
+ if (hContact == INVALID_CONTACT_ID)
+ continue;
+
if (db_get_sm(hContact, "CList", "Group").IsEmpty()) {
if (!bCreated) {
Clist_GroupCreate(0, szGroup);