From 090f0c326cfda18c4a255c56acb72beaa5e1e339 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Mon, 19 Oct 2020 17:27:00 +0200 Subject: [PATCH] fix: Do not require unrequired field in supported versions response --- lib/encryption/encryption.dart | 3 ++- lib/matrix_api/model/supported_versions.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/encryption/encryption.dart b/lib/encryption/encryption.dart index 9741460..d487db5 100644 --- a/lib/encryption/encryption.dart +++ b/lib/encryption/encryption.dart @@ -118,7 +118,8 @@ class Encryption { runInRoot(() => keyVerificationManager.handleEventUpdate(update))); } if (update.content['sender'] == client.userID && - !update.content['unsigned'].containsKey('transaction_id')) { + (!update.content.containsKey('unsigned') || + !update.content['unsigned'].containsKey('transaction_id'))) { // maybe we need to re-try SSSS secrets unawaited(runInRoot(() => ssss.periodicallyRequestMissingCache())); } diff --git a/lib/matrix_api/model/supported_versions.dart b/lib/matrix_api/model/supported_versions.dart index e5beaf3..33ab8c4 100644 --- a/lib/matrix_api/model/supported_versions.dart +++ b/lib/matrix_api/model/supported_versions.dart @@ -22,7 +22,7 @@ class SupportedVersions { SupportedVersions.fromJson(Map json) { versions = json['versions'].cast(); - unstableFeatures = Map.from(json['unstable_features']); + unstableFeatures = Map.from(json['unstable_features'] ?? {}); } Map toJson() {