From 1eef94e8d9afc52cb575dd4dab8bd31d29f3bf65 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 25 Sep 2021 22:39:11 +0400 Subject: [PATCH] Fix possible crash in delayed typing updates. --- Telegram/SourceFiles/history/history_widget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 7143401429..b12867f6f8 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1411,15 +1411,16 @@ bool HistoryWidget::updateStickersByEmoji() { } void HistoryWidget::fieldChanged() { - const auto typing = (_history - && !_inlineBot - && !_editMsgId - && (_textUpdateEvents & TextUpdateEvent::SendTyping)); + const auto updateTyping = (_textUpdateEvents & TextUpdateEvent::SendTyping); InvokeQueued(this, [=] { updateInlineBotQuery(); const auto choosingSticker = updateStickersByEmoji(); - if (!choosingSticker && typing) { + if (_history + && !_inlineBot + && !_editMsgId + && !choosingSticker + && updateTyping) { session().sendProgressManager().update( _history, Api::SendProgressType::Typing);