aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb
index 5f7702a..ed56ff4 100644
--- a/lib/leap_cli/commands/user.rb
+++ b/lib/leap_cli/commands/user.rb
@@ -92,9 +92,12 @@ module LeapCli
#
def pick_pgp_key
secret_keys = GPGME::Key.find(:secret)
+ if secret_keys.empty?
+ progress("Skipping OpenPGP setup because I could not find any OpenPGP keys for you")
+ return nil
+ end
assert_bin! 'gpg'
- assert! secret_keys.any?, 'Sorry, could not find any OpenPGP keys for you.'
if secret_keys.length > 1
key_index = numbered_choice_menu('Choose your OpenPGP public key', secret_keys) do |key, i|