From e0c74c9546941fb3ab842ebb2bc3e1825a32aae7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Jul 2017 17:44:45 +0300 Subject: [PATCH] Fix crash in handlePendingHistoryUpdate(). This method is called from InvokeQueued, so the auth session could be destroyed already and should be checked before being accessed. --- Telegram/SourceFiles/facades.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 9b938504d..1a009cac7 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -361,6 +361,9 @@ void historyMuteUpdated(History *history) { } void handlePendingHistoryUpdate() { + if (!AuthSession::Exists()) { + return; + } AuthSession::Current().data().pendingHistoryResize().notify(true); for (auto item : base::take(Global::RefPendingRepaintItems())) {