2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix possible crash on forum switch off.

This commit is contained in:
John Preston
2022-12-06 23:22:28 +04:00
parent 76d44172f1
commit d827045199

View File

@@ -164,9 +164,7 @@ void ChannelData::setFlags(ChannelDataFlags which) {
const auto taken = ((diff & Flag::Forum) && !(which & Flag::Forum))
? mgInfo->takeForumData()
: nullptr;
if (const auto raw = taken.get()) {
owner().forumIcons().clearUserpicsReset(taken.get());
} else if ((diff & Flag::Forum) && (which & Flag::Forum)) {
if ((diff & Flag::Forum) && (which & Flag::Forum)) {
mgInfo->ensureForum(this);
}
_flags.set(which);
@@ -192,6 +190,9 @@ void ChannelData::setFlags(ChannelDataFlags which) {
}
}
}
if (const auto raw = taken.get()) {
owner().forumIcons().clearUserpicsReset(raw);
}
}
void ChannelData::addFlags(ChannelDataFlags which) {