From 07eab8555a0abbd62f615fa291f1d79e848f060e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 6 Mar 2020 15:07:24 +0400 Subject: [PATCH] Fix crash in lottie animation destroy-on-init. --- Telegram/SourceFiles/history/history_widget.cpp | 4 +++- Telegram/lib_lottie | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 0abfd9dddf..7514da8b34 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5106,6 +5106,8 @@ int HistoryWidget::countInitialScrollTop() { } void HistoryWidget::createUnreadBarIfBelowVisibleArea(int withScrollTop) { + Expects(_history != nullptr); + if (_history->unreadBar()) { return; } @@ -5227,7 +5229,7 @@ void HistoryWidget::updateHistoryGeometry( newScrollTop = countInitialScrollTop(); _historyInited = true; _scrollToAnimation.stop(); - } else if (wasAtBottom && !loadedDown) { + } else if (wasAtBottom && !loadedDown && !_history->unreadBar()) { newScrollTop = countAutomaticScrollTop(); } else { newScrollTop = std::min( diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie index 17b6a6d532..0f6c9f4acb 160000 --- a/Telegram/lib_lottie +++ b/Telegram/lib_lottie @@ -1 +1 @@ -Subproject commit 17b6a6d53252b3e3ff02b113e352c152bd697896 +Subproject commit 0f6c9f4acbdc2412a1a941b4ee96b150589b8369