2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 07:35:12 +00:00

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

View File

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