Fixed possible crash in scroll of empty HistoryWidget.

This commit is contained in:
23rd 2021-10-08 19:10:39 +03:00
parent 746f8d835d
commit 455c7280a4

View file

@ -264,7 +264,8 @@ HistoryWidget::HistoryWidget(
}), lifetime());
_scroll->addContentRequests(
) | rpl::start_with_next([=] {
if (_history->loadedAtBottom()
if (_history
&& _history->loadedAtBottom()
&& session().data().sponsoredMessages().append(_history)) {
_scroll->contentAdded();
}