Guard the forum teardown media unload against a zero root

Task: 2026/08/20/guard-forum-teardown-unload-against-zero-root
This commit is contained in:
John Preston
2026-08-20 18:13:09 +04:00
committed by 23rd
parent 1e60e9091c
commit 55d5ad07c6

View File

@@ -86,10 +86,12 @@ Forum::~Forum() {
auto &changes = session().changes();
const auto peerId = _history->peer->id;
for (const auto &[rootId, topic] : _topics) {
storage.unload(Storage::SharedMediaUnloadThread(
peerId,
rootId,
PeerId()));
if (rootId) {
storage.unload(Storage::SharedMediaUnloadThread(
peerId,
rootId,
PeerId()));
}
_history->setForwardDraft(rootId, PeerId(), {});
const auto raw = topic.get();