From d11fcb0ff625964a77329228590fd68025753791 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 9 Nov 2021 20:21:40 +0100 Subject: [PATCH] Fix parsing some exotic image packs --- CMakeLists.txt | 2 +- io.github.NhekoReborn.Nheko.yaml | 2 +- src/Cache_p.h | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d033d00f..0c43721f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,7 +388,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG fc5d01c775bde656b6d69954189522d138efe022 + GIT_TAG bacb7e524ff0f38591b88b248d8d8409b7fd49a0 ) set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml index fdd22ea6..af010422 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml @@ -163,7 +163,7 @@ modules: buildsystem: cmake-ninja name: mtxclient sources: - - commit: fc5d01c775bde656b6d69954189522d138efe022 + - commit: bacb7e524ff0f38591b88b248d8d8409b7fd49a0 type: git url: https://github.com/Nheko-Reborn/mtxclient.git - config-opts: 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(), value)) - events.push_back(json::parse(value).get>()); + try { + if (eventsDb.get(txn, json::parse(data)["id"].get(), value)) + events.push_back(json::parse(value).get>()); + } catch (std::exception &e) { + nhlog::db()->warn("Failed to parse state event: {}", e.what()); + } } } }