diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 8fabe443b..bbf044e6a 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -318,6 +318,9 @@ func changePassword(ctx *cli.Context) error { if err != nil { return cli.NewExitError(err, 1) } + if len(wall.Accounts) == 0 { + return cli.NewExitError("wallet has no accounts", 1) + } addrFlag := ctx.Generic("address").(*flags.Address) if addrFlag.IsSet { // Check for account presence first before asking for password.