fix: Do not require unrequired field in supported versions response

This commit is contained in:
Sorunome 2020-10-19 17:27:00 +02:00
parent d116a52ea9
commit 090f0c326c
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -22,7 +22,7 @@ class SupportedVersions {
SupportedVersions.fromJson(Map<String, dynamic> json) {
versions = json['versions'].cast<String>();
unstableFeatures = Map<String, bool>.from(json['unstable_features']);
unstableFeatures = Map<String, bool>.from(json['unstable_features'] ?? {});
}
Map<String, dynamic> toJson() {