Fix parsing some exotic image packs

This commit is contained in:
Nicolas Werner 2021-11-09 20:21:40 +01:00
parent add5dfce7f
commit d11fcb0ff6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 9 additions and 4 deletions

View file

@ -388,7 +388,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare( FetchContent_Declare(
MatrixClient MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git 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_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")

View file

@ -163,7 +163,7 @@ modules:
buildsystem: cmake-ninja buildsystem: cmake-ninja
name: mtxclient name: mtxclient
sources: sources:
- commit: fc5d01c775bde656b6d69954189522d138efe022 - commit: bacb7e524ff0f38591b88b248d8d8409b7fd49a0
type: git type: git
url: https://github.com/Nheko-Reborn/mtxclient.git url: https://github.com/Nheko-Reborn/mtxclient.git
- config-opts: - config-opts:

View file

@ -29,6 +29,7 @@
#include "CacheCryptoStructs.h" #include "CacheCryptoStructs.h"
#include "CacheStructs.h" #include "CacheStructs.h"
#include "Logging.h"
class Cache : public QObject class Cache : public QObject
{ {
@ -518,8 +519,12 @@ private:
while (cursor.get(typeStrV, data, first ? MDB_FIRST_DUP : MDB_NEXT_DUP)) { while (cursor.get(typeStrV, data, first ? MDB_FIRST_DUP : MDB_NEXT_DUP)) {
first = false; first = false;
if (eventsDb.get(txn, json::parse(data)["id"].get<std::string>(), value)) try {
events.push_back(json::parse(value).get<mtx::events::StateEvent<T>>()); 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());
}
} }
} }
} }