Skip to content

Commit 9065573

Browse files
committed
cmd/geth: fix recover command crash if no param is supplied
1 parent e3f36d9 commit 9065573

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)