diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-11-05 17:53:50 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-11-05 17:53:50 +0800 |
commit | 90655736ed11859d185849f4f5a374b30095d932 (patch) | |
tree | 63a81566cc5829b3bb7969260e929193a27423be /cmd/geth/main.go | |
parent | e3f36d97288636f222f451b26c7c89e334ce4869 (diff) | |
download | go-tangerine-90655736ed11859d185849f4f5a374b30095d932.tar.gz go-tangerine-90655736ed11859d185849f4f5a374b30095d932.tar.zst go-tangerine-90655736ed11859d185849f4f5a374b30095d932.zip |
cmd/geth: fix recover command crash if no param is supplied
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 4 |
1 files changed, 2 insertions, 2 deletions
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) |