summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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()); + } } } }