diff --git a/lib/src/utils/device_keys_list.dart b/lib/src/utils/device_keys_list.dart index 1c76b750..7e3e217b 100644 --- a/lib/src/utils/device_keys_list.dart +++ b/lib/src/utils/device_keys_list.dart @@ -267,10 +267,13 @@ abstract class SignableKey extends MatrixSignableKey { } var haveValidSignature = false; var gotSignatureFromCache = false; - if (validSignatures?[otherUserId][fullKeyId] == true) { + final fullKeyIdBool = validSignatures + ?.tryGetMap(otherUserId) + ?.tryGet(fullKeyId); + if (fullKeyIdBool == true) { haveValidSignature = true; gotSignatureFromCache = true; - } else if (validSignatures?[otherUserId][fullKeyId] == false) { + } else if (fullKeyIdBool == false) { haveValidSignature = false; gotSignatureFromCache = true; }