Commit e836076d authored by Vladislav Yarmak's avatar Vladislav Yarmak

[pgp] handle case when some of enumerated keys have no non-empty uids

parent 02b15215
......@@ -116,7 +116,11 @@ class PGP(gnupg.GPG, metaclass=Singleton):
for key in result:
# Take first not empty uid
keys[key['fingerprint']] = next(uid for uid in key['uids'] if uid)
try:
keys[key['fingerprint']] = next(uid for uid in key['uids'] if uid)
except StopIteration:
# No key non-empty uids present
keys[key['fingerprint']] = ''
return keys
@staticmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment