Fix another imagepack crash

This commit is contained in:
Tobias Fella
2023-05-06 21:04:49 +02:00
parent 4a29e0d0e1
commit d33a0c6644

View File

@@ -83,10 +83,13 @@ void ImagePacksModel::setRoom(NeoChatRoom *room)
const auto &stickerRoom = m_room->connection()->room(roomId);
for (const auto &packKey : packs.keys()) {
#ifdef QUOTIENT_07
const auto packContent = stickerRoom->currentState().get<ImagePackEvent>(packKey)->content();
if (!packContent.pack->usage || (packContent.pack->usage->contains("emoticon") && showEmoticons())
|| (packContent.pack->usage->contains("sticker") && showStickers())) {
m_events += packContent;
const auto &pack = stickerRoom->currentState().get<ImagePackEvent>(packKey);
if (pack) {
const auto packContent = pack->content();
if (!packContent.pack->usage || (packContent.pack->usage->contains("emoticon") && showEmoticons())
|| (packContent.pack->usage->contains("sticker") && showStickers())) {
m_events += packContent;
}
}
#endif
}