From 90655736ed11859d185849f4f5a374b30095d932 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Thu, 5 Nov 2015 11:53:50 +0200 Subject: cmd/geth: fix recover command crash if no param is supplied --- cmd/geth/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/geth') diff --git a/cmd/geth/main.go b/cmd/geth/main.go index e74ddd0d0..0fb654eed 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -542,10 +542,10 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, i func blockRecovery(ctx *cli.Context) { utils.CheckLegalese(utils.MustDataDir(ctx)) - arg := ctx.Args().First() - if len(ctx.Args()) < 1 && len(arg) > 0 { + if len(ctx.Args()) < 1 { glog.Fatal("recover requires block number or hash") } + arg := ctx.Args().First() cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) utils.CheckLegalese(cfg.DataDir) -- cgit