From faba36d47615984e5b11c375bb0ed23ad05681de Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Mon, 18 Oct 2021 15:45:29 +0200 Subject: [PATCH] fix: Missing null check in a nested json map --- lib/src/utils/device_keys_list.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }