From 599cc35e570cfa6ef6edfc25fff1ded7cfa4b0cc Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 29 Dec 2022 09:57:45 +0400 Subject: [PATCH] Fix a crash in history clear. --- Telegram/SourceFiles/history/history_item.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index e067d851aa..b992a7f6c9 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -1431,12 +1431,18 @@ void HistoryItem::applyEdition(const MTPDmessageService &message) { if (wasGrouped) { history()->owner().groups().unregisterMessage(this); } + if (const auto reply = Get()) { + reply->clearData(this); + } clearDependencyMessage(); UpdateComponents(0); createServiceFromMtp(message); applyServiceDateEdition(message); finishEditionToEmpty(); } else if (isService()) { + if (const auto reply = Get()) { + reply->clearData(this); + } clearDependencyMessage(); UpdateComponents(0); createServiceFromMtp(message);