summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-03-25 18:40:27 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2022-03-25 18:40:27 +0100
commit7256c70108c17dbf04a3723d29b829b0fd7dffef (patch)
tree307d505296e117d95545d608ebaa5943e4ff5974 /src
parentRelease v0.9.3 (diff)
downloadnheko-7256c70108c17dbf04a3723d29b829b0fd7dffef.tar.xz
Fix crash on missing pack description
Diffstat (limited to 'src')
-rw-r--r--src/Cache.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index be3dfe69..30077850 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -3708,8 +3708,10 @@ Cache::getImagePacks(const std::string &room_id, std::optional<bool> stickers) auto addPack = [&infos, stickers](const mtx::events::msc2545::ImagePack &pack, const std::string &source_room, const std::string &state_key) { - bool pack_matches = !stickers.has_value() || - (stickers.value() ? pack.pack->is_sticker() : pack.pack->is_emoji()); + bool pack_is_sticker = pack.pack ? pack.pack->is_sticker() : true; + bool pack_is_emoji = pack.pack ? pack.pack->is_emoji() : true; + bool pack_matches = + !stickers.has_value() || (stickers.value() ? pack_is_sticker : pack_is_emoji); ImagePackInfo info; info.source_room = source_room;