Fixed crash on checking sponsored state with closed dialog.

This commit is contained in:
23rd 2022-11-07 20:13:35 +03:00 committed by John Preston
parent 6af93b3497
commit 7993c6207a
1 changed files with 4 additions and 1 deletions

View File

@ -2289,7 +2289,10 @@ void HistoryWidget::showHistory(
{
_scroll->setTrackingContent(false);
const auto checkState = crl::guard(this, [=] {
const auto checkState = crl::guard(this, [=, history = _history] {
if (history != _history) {
return;
}
auto &sponsored = session().data().sponsoredMessages();
using State = Data::SponsoredMessages::State;
const auto state = sponsored.state(_history);