From e63fd013199b9b3d411b304459d9a964f42756f5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 6 Dec 2020 19:13:14 +0300 Subject: fix for rare crash in Discord --- protocols/Discord/src/proto.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'protocols/Discord/src') 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) -- cgit v1.2.3