Fix a crash in history clear.

This commit is contained in:
John Preston 2022-12-29 09:57:45 +04:00
parent bd367da1bd
commit 599cc35e57
1 changed files with 6 additions and 0 deletions

View File

@ -1431,12 +1431,18 @@ void HistoryItem::applyEdition(const MTPDmessageService &message) {
if (wasGrouped) {
history()->owner().groups().unregisterMessage(this);
}
if (const auto reply = Get<HistoryMessageReply>()) {
reply->clearData(this);
}
clearDependencyMessage();
UpdateComponents(0);
createServiceFromMtp(message);
applyServiceDateEdition(message);
finishEditionToEmpty();
} else if (isService()) {
if (const auto reply = Get<HistoryMessageReply>()) {
reply->clearData(this);
}
clearDependencyMessage();
UpdateComponents(0);
createServiceFromMtp(message);