fix UB when all reactions on a msg are removed and one is added again

This commit is contained in:
ouwou
2021-10-27 03:01:53 -04:00
parent b248e0ae9a
commit 84b1b62e0e

View File

@@ -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) {