cmd/utils: frdb close if not nil

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-09-26 08:54:30 +08:00
parent 38c200209a
commit ec5a4e6c3a

View file

@ -2091,7 +2091,9 @@ func tryMakeReadOnlyDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database
if err != nil {
readonly = false
}
frdb.Close()
if frdb != nil {
frdb.Close()
}
}
return MakeChainDatabase(ctx, stack, readonly)
}