We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72fb0f6 commit 177e568Copy full SHA for 177e568
mautrix/types/crypto.py
@@ -71,6 +71,8 @@ def first_ed25519_key(self) -> Optional[SigningKey]:
71
return self.first_key_with_algorithm(EncryptionKeyAlgorithm.ED25519)
72
73
def first_key_with_algorithm(self, alg: EncryptionKeyAlgorithm) -> Optional[SigningKey]:
74
+ if not self.keys:
75
+ return None
76
try:
77
return next(key for key_id, key in self.keys.items() if key_id.algorithm == alg)
78
except StopIteration:
0 commit comments