fix: Missing null check in a nested json map

This commit is contained in:
Krille Fear 2021-10-18 15:45:29 +02:00
parent f36299c3d7
commit faba36d476
1 changed files with 5 additions and 2 deletions

View File

@ -267,10 +267,13 @@ abstract class SignableKey extends MatrixSignableKey {
}
var haveValidSignature = false;
var gotSignatureFromCache = false;
if (validSignatures?[otherUserId][fullKeyId] == true) {
final fullKeyIdBool = validSignatures
?.tryGetMap<String, dynamic>(otherUserId)
?.tryGet<bool>(fullKeyId);
if (fullKeyIdBool == true) {
haveValidSignature = true;
gotSignatureFromCache = true;
} else if (validSignatures?[otherUserId][fullKeyId] == false) {
} else if (fullKeyIdBool == false) {
haveValidSignature = false;
gotSignatureFromCache = true;
}