Fix possible crash in story deletion.

Fixes #26571.
This commit is contained in:
John Preston 2023-07-25 20:24:13 +04:00
parent a85f33f7d3
commit 35f0f87f73
1 changed files with 4 additions and 3 deletions

View File

@ -872,9 +872,10 @@ bool Controller::changeShown(Data::Story *story) {
if (_shown == id && !sessionChanged) {
return false;
}
if (const auto now = this->story()) {
now->owner().stories().unregisterPolling(
now,
if (_shown) {
Assert(_session != nullptr);
_session->data().stories().unregisterPolling(
_shown,
Data::Stories::Polling::Viewer);
}
if (sessionChanged) {