fix: Type error when uploading room keys

This commit is contained in:
Krille 2024-06-25 08:33:35 +02:00
parent a1e218a658
commit 29cd5a299a
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652
1 changed files with 4 additions and 4 deletions

View File

@ -89,10 +89,10 @@ class SessionKey {
// we need to try...catch as the map used to be <String, int> and that will throw an error.
senderClaimedKeys = (parsedSenderClaimedKeys.isNotEmpty)
? parsedSenderClaimedKeys
: (content['sender_claimed_keys'] is Map
? content['sender_claimed_keys']
.catchMap((k, v) => MapEntry<String, String>(k, v))
: (content['sender_claimed_ed25519_key'] is String
: (content
.tryGetMap<String, dynamic>('sender_claimed_keys')
?.catchMap((k, v) => MapEntry<String, String>(k, v)) ??
(content['sender_claimed_ed25519_key'] is String
? <String, String>{
'ed25519': content['sender_claimed_ed25519_key']
}