From fe1f198d99cee52a224c9f6f0880c34122d58b0f Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 12 Feb 2019 16:53:46 +0300 Subject: [PATCH] Fix crash in last message checking. Fixes #5683. --- Telegram/SourceFiles/history/history.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 2d6e3fbd9..f267ba0b3 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -2089,8 +2089,9 @@ void History::setLastMessage(HistoryItem *item) { if (_lastMessage) { if (*_lastMessage == item) { return; - } else if (!IsServerMsgId((*_lastMessage)->id) - && (*_lastMessage)->date() > item->date()) { + } else if (*_lastMessage + && !IsServerMsgId((*_lastMessage)->id) + && (*_lastMessage)->date() > item->date()) { return; } }