diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 8c4dfa5dc..52a9803d3 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -480,7 +480,10 @@ not_null History::insertItem( } void History::destroyMessage(not_null item) { - Expects(item->isHistoryEntry() || !item->mainView()); + // Expects(item->isHistoryEntry() || !item->mainView()); + if (!(item->isHistoryEntry() || !item->mainView())) { + return; // AyuGram: fix crash when using `saveDeletedMessages` + } const auto peerId = peer->id; if (item->isHistoryEntry()) {