mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
fix UB when all reactions on a msg are removed and one is added again
This commit is contained in:
1 parent
b248e0ae9a
commit
84b1b62e0e
1 file changed
+3
-1
@@ -116,8 +116,10 @@ void ChatMessageItemContainer::UpdateContent() {
|
||||
}
|
||||
|
||||
void ChatMessageItemContainer::UpdateReactions() {
|
||||
if (m_reactions_component != nullptr)
|
||||
if (m_reactions_component != nullptr) {
|
||||
delete m_reactions_component;
|
||||
m_reactions_component = nullptr;
|
||||
}
|
||||
|
||||
const auto data = Abaddon::Get().GetDiscordClient().GetMessage(ID);
|
||||
if (data->Reactions.has_value() && data->Reactions->size() > 0) {
|
||||
|
||||
Reference in new issue
Block a user