From b57152a1c906c4c97e853c3d19770bd515e1d44f Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 18 Jun 2022 00:10:47 +0200 Subject: [PATCH] Skip migration if sender_key is not a string or present --- src/Cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Cache.cpp b/src/Cache.cpp index 1df16bf5..e8578655 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -1326,7 +1326,9 @@ Cache::runMigrations() std::map inboundSessions; std::map megolmSessionData; while (cursor.get(key, value, MDB_NEXT)) { - auto indexVal = nlohmann::json::parse(key); + auto indexVal = nlohmann::json::parse(key); + if (!indexVal.contains("sender_key") || !indexVal.at("sender_key").is_string()) + continue; auto sender_key = indexVal["sender_key"].get(); indexVal.erase("sender_key");