summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-06-17 13:40:08 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-06-17 13:40:08 +0300
commit1923923f9c370f19491b347675a3a1d108bf7eac (patch)
tree04605bc4856e0f2ab07b813787a1408b378d72ce
parent238a095707c2e2f4c66334c58705a08497f02b5a (diff)
fixes #4470 (Реакции: падение при попытке поставить пустую реакцию)
-rw-r--r--protocols/Telegram/src/menus.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/Telegram/src/menus.cpp b/protocols/Telegram/src/menus.cpp
index 0e15de32e4..acdbb6e54b 100644
--- a/protocols/Telegram/src/menus.cpp
+++ b/protocols/Telegram/src/menus.cpp
@@ -159,10 +159,10 @@ public:
DB::EventInfo dbei(m_hEvent, false);
__int64 msgId = ::dbei2id(dbei);
- char *pszEmoji = (char *)cmbReactions.GetCurData();
- auto reaction = TD::make_object<TD::reactionTypeEmoji>(pszEmoji);
-
- m_proto->SendQuery(new TD::addMessageReaction(m_pUser->chatId, msgId, std::move(reaction), false, false));
+ if (char *pszEmoji = (char *)cmbReactions.GetCurData()) {
+ auto reaction = TD::make_object<TD::reactionTypeEmoji>(pszEmoji);
+ m_proto->SendQuery(new TD::addMessageReaction(m_pUser->chatId, msgId, std::move(reaction), false, false));
+ }
return true;
}
};