Don't crash when sticker pack room doesn't exist

BUG: 476923
This commit is contained in:
Tobias Fella
2023-11-24 16:43:16 +01:00
parent 840903128c
commit dd6eaac556

View File

@@ -102,6 +102,9 @@ void ImagePacksModel::reloadImages()
}
auto packs = rooms[roomId].toObject();
const auto &stickerRoom = m_room->connection()->room(roomId);
if (!stickerRoom) {
continue;
}
for (const auto &packKey : packs.keys()) {
if (const auto &pack = stickerRoom->currentState().get<ImagePackEvent>(packKey)) {
const auto packContent = pack->content();