From fafb9cc4a614b69bbd9299e784fa0652ebe1cf2f Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 19 Mar 2023 14:04:13 +0100 Subject: [PATCH] Don't try to load emotes from space parents we are not in --- src/Cache.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Cache.cpp b/src/Cache.cpp index 7471ec40..274b0840 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -4179,8 +4179,15 @@ Cache::getImagePacks(const std::string &room_id, std::optional stickers) for (const auto &parent : getStateEventsWithType(txn, current_room)) { - if (parent.content.canonical && parent.content.via && !parent.content.via->empty()) - addRoomAndCanonicalParents(parent.state_key); + if (parent.content.canonical && parent.content.via && !parent.content.via->empty()) { + try { + addRoomAndCanonicalParents(parent.state_key); + } catch (const lmdb::error &) { + nhlog::db()->debug("Skipping events from parent community, because we are " + "not joined to it: {}", + parent.state_key); + } + } } };