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(
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 "")

View File

@ -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:

View File

@ -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());
}
}
}
}