diff options
author | George Hazan <ghazan@miranda.im> | 2020-12-06 19:13:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-12-06 19:13:14 +0300 |
commit | e63fd013199b9b3d411b304459d9a964f42756f5 (patch) | |
tree | 1480f4e37c56633be0953616ddb73cb68d03b0f5 | |
parent | f571dabb896633c6dbfda0837ca87e4b4832f7a4 (diff) |
fix for rare crash in Discord
-rw-r--r-- | protocols/Discord/src/proto.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 2d4befca37..898f30ff8b 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -477,14 +477,13 @@ void __cdecl CDiscordProto::GetAwayMsgThread(void *param) Thread_SetName("Jabber: GetAwayMsgThread"); auto *pUser = (CDiscordUser *)param; - if (pUser != nullptr) { - if (!pUser->wszTopic.IsEmpty()) { - ProtoBroadcastAck(pUser->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)pUser->wszTopic.c_str()); - return; - } - } + if (pUser == nullptr) + return; - ProtoBroadcastAck(pUser->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); + if (pUser->wszTopic.IsEmpty()) + ProtoBroadcastAck(pUser->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); + else + ProtoBroadcastAck(pUser->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)pUser->wszTopic.c_str()); } HANDLE CDiscordProto::GetAwayMsg(MCONTACT hContact) |