Skip to content

Commit 76390ef

Browse files
committed
Merge pull request #1966 from karalabe/fix-recover-noparam-panic
cmd/geth: fix recover command crash if no param is supplied
2 parents 636f67f + 9065573 commit 76390ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/geth/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int, i
542542
func blockRecovery(ctx *cli.Context) {
543543
utils.CheckLegalese(utils.MustDataDir(ctx))
544544

545-
arg := ctx.Args().First()
546-
if len(ctx.Args()) < 1 && len(arg) > 0 {
545+
if len(ctx.Args()) < 1 {
547546
glog.Fatal("recover requires block number or hash")
548547
}
548+
arg := ctx.Args().First()
549549

550550
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
551551
utils.CheckLegalese(cfg.DataDir)

0 commit comments

Comments
 (0)