mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash in history clear.
This commit is contained in:
parent
60e36b1411
commit
cc8f4aa24f
1 changed files with 2 additions and 2 deletions
|
@ -2947,8 +2947,8 @@ void History::clear(ClearType type) {
|
||||||
changeUnreadCount(-unreadCount());
|
changeUnreadCount(-unreadCount());
|
||||||
if (type == ClearType::DeleteChat) {
|
if (type == ClearType::DeleteChat) {
|
||||||
setLastMessage(nullptr);
|
setLastMessage(nullptr);
|
||||||
} else {
|
} else if (_lastMessage && *_lastMessage) {
|
||||||
if (_lastMessage && IsServerMsgId((*_lastMessage)->id)) {
|
if (IsServerMsgId((*_lastMessage)->id)) {
|
||||||
(*_lastMessage)->applyEditionToHistoryCleared();
|
(*_lastMessage)->applyEditionToHistoryCleared();
|
||||||
} else {
|
} else {
|
||||||
_lastMessage = std::nullopt;
|
_lastMessage = std::nullopt;
|
||||||
|
|
Loading…
Add table
Reference in a new issue