From b63985c974b3019a99a74ef1697034e03d457b2d Mon Sep 17 00:00:00 2001 From: Ian Bishop Date: Wed, 25 Oct 2017 14:31:30 -0500 Subject: [PATCH] renew/revoke - don't panic on wrong account (#446) --- cli_handlers.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cli_handlers.go b/cli_handlers.go index 79bbb37e..b8790c4b 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -329,8 +329,10 @@ func run(c *cli.Context) error { } func revoke(c *cli.Context) error { - - conf, _, client := setup(c) + conf, acc, client := setup(c) + if acc.Registration == nil { + logger().Fatalf("Account %s is not registered. Use 'run' to register a new account.\n", acc.Email) + } err := checkFolder(conf.CertPath()) if err != nil { @@ -355,7 +357,10 @@ func revoke(c *cli.Context) error { } func renew(c *cli.Context) error { - conf, _, client := setup(c) + conf, acc, client := setup(c) + if acc.Registration == nil { + logger().Fatalf("Account %s is not registered. Use 'run' to register a new account.\n", acc.Email) + } if len(c.GlobalStringSlice("domains")) <= 0 { logger().Fatal("Please specify at least one domain.")