summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/dispatch.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index abcae9afb8..1d4209715f 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -521,10 +521,11 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew)
if (userId == m_ownId)
dbei.flags |= DBEF_READ | DBEF_SENT;
- if (auto &nReply = pRoot["message_reference"]) {
- _i64toa(::getId(nReply["message_id"]), szReplyId, 10);
- dbei.szReplyId = szReplyId;
- }
+ if (auto &nReply = pRoot["message_reference"])
+ if (auto replyId = ::getId(nReply["message_id"])) {
+ _i64toa(replyId, szReplyId, 10);
+ dbei.szReplyId = szReplyId;
+ }
debugLogA("store a message from private user %lld, channel id %lld", pUser->id, pUser->channelId);