summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/openpgp.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/keymanager/openpgp.py')
-rw-r--r--src/leap/keymanager/openpgp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py
index ee37a342..6a825cda 100644
--- a/src/leap/keymanager/openpgp.py
+++ b/src/leap/keymanager/openpgp.py
@@ -327,7 +327,10 @@ class OpenPGPScheme(EncryptionScheme):
privkey = gpg.list_keys(secret=True).pop()
except IndexError:
pass
- pubkey = gpg.list_keys(secret=False).pop() # unitary keyring
+ try:
+ pubkey = gpg.list_keys(secret=False).pop() # unitary keyring
+ except IndexError:
+ return (None, None)
# extract adress from first uid on key
match = re.match(mail_regex, pubkey['uids'].pop())