summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-09 20:21:40 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-09 20:22:02 +0100
commitd11fcb0ff625964a77329228590fd68025753791 (patch)
tree3caed1e9bfecbcf16e14cf5cb4abd0ae8ef6e84e /src
parentMerge pull request #798 from LorenDB/fixRRDialog (diff)
downloadnheko-d11fcb0ff625964a77329228590fd68025753791.tar.xz
Fix parsing some exotic image packs
Diffstat (limited to 'src')
-rw-r--r--src/Cache_p.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h
index a529bc37..b995eed1 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -29,6 +29,7 @@
 
 #include "CacheCryptoStructs.h"
 #include "CacheStructs.h"
+#include "Logging.h"
 
 class Cache : public QObject
 {
@@ -518,8 +519,12 @@ private:
                 while (cursor.get(typeStrV, data, first ? MDB_FIRST_DUP : MDB_NEXT_DUP)) {
                     first = false;
 
-                    if (eventsDb.get(txn, json::parse(data)["id"].get<std::string>(), value))
-                        events.push_back(json::parse(value).get<mtx::events::StateEvent<T>>());
+                    try {
+                        if (eventsDb.get(txn, json::parse(data)["id"].get<std::string>(), value))
+                            events.push_back(json::parse(value).get<mtx::events::StateEvent<T>>());
+                    } catch (std::exception &e) {
+                        nhlog::db()->warn("Failed to parse state event: {}", e.what());
+                    }
                 }
             }
         }