diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-10 20:24:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-10 20:24:47 +0300 |
commit | 777b9bc02bec68f5075cf6cc7a17b2c1ef2bde91 (patch) | |
tree | cc7f96ddbd580a96182c967ebc53dd9aadd527f4 | |
parent | 58580c677c86d54c83b351bebab33f488350107f (diff) |
ICQ: fix for very rare crash on login
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 6 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/version.h | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 163fc56b3a..b6e785a0c4 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -270,7 +270,7 @@ class CIcqProto : public PROTO<CIcqProto> void CheckLastId(MCONTACT hContact, const JSONNode&); void Json2int(MCONTACT, const JSONNode&, const char *szJson, const char *szSetting); void Json2string(MCONTACT, const JSONNode&, const char *szJson, const char *szSetting); - MCONTACT ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact = -1); + MCONTACT ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact = INVALID_CONTACT_ID); void ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNode &msg, bool bCreateRead, bool bLocalTime); void OnLoggedIn(void); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 2680fae71f..024fc34aa8 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -293,7 +293,11 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) return si->hContact; } - if (hContact == -1) { + if (hContact == INVALID_CONTACT_ID) { + if (wszId.IsEmpty()) { + debugLogA("no aimId in packet? so strange..."); + return INVALID_CONTACT_ID; + } hContact = CreateContact(wszId, false); FindContactByUIN(wszId)->m_bInList = true; } diff --git a/protocols/ICQ-WIM/src/version.h b/protocols/ICQ-WIM/src/version.h index 3d6f84fa83..07aa40c64b 100644 --- a/protocols/ICQ-WIM/src/version.h +++ b/protocols/ICQ-WIM/src/version.h @@ -1,6 +1,6 @@ #define __MAJOR_VERSION 0 -#define __MINOR_VERSION 95 -#define __RELEASE_NUM 12 +#define __MINOR_VERSION 96 +#define __RELEASE_NUM 1 #define __BUILD_NUM 1 #include <stdver.h> |