forked from OpenGamers/abaddon
fix UB when all reactions on a msg are removed and one is added again
This commit is contained in:
@@ -116,8 +116,10 @@ void ChatMessageItemContainer::UpdateContent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ChatMessageItemContainer::UpdateReactions() {
|
void ChatMessageItemContainer::UpdateReactions() {
|
||||||
if (m_reactions_component != nullptr)
|
if (m_reactions_component != nullptr) {
|
||||||
delete m_reactions_component;
|
delete m_reactions_component;
|
||||||
|
m_reactions_component = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
const auto data = Abaddon::Get().GetDiscordClient().GetMessage(ID);
|
const auto data = Abaddon::Get().GetDiscordClient().GetMessage(ID);
|
||||||
if (data->Reactions.has_value() && data->Reactions->size() > 0) {
|
if (data->Reactions.has_value() && data->Reactions->size() > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user