From bc883aab9e95296fc7236ee114a6993d4d904ae7 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 4 Aug 2020 15:53:34 -0700 Subject: [PATCH] Return an error when wallet is nil rather than panic (#6875) --- validator/accounts/v2/wallet_create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validator/accounts/v2/wallet_create.go b/validator/accounts/v2/wallet_create.go index 87f141d43..4577196c6 100644 --- a/validator/accounts/v2/wallet_create.go +++ b/validator/accounts/v2/wallet_create.go @@ -58,6 +58,9 @@ func CreateWallet(cliCtx *cli.Context) (*Wallet, error) { } func createDirectKeymanagerWallet(cliCtx *cli.Context, wallet *Wallet) error { + if wallet == nil { + return errors.New("nil wallet") + } if err := wallet.SaveWallet(); err != nil { return errors.Wrap(err, "could not save wallet to disk") }