From 01c9cf1cb5ed1f55bb6bc87c5ce18a818c5c6cec Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 23 Jun 2017 09:56:30 +0200 Subject: [PATCH] node: don't return non-nil database on error --- node/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/service.go b/node/service.go index 5e1eb0e64..55062a500 100644 --- a/node/service.go +++ b/node/service.go @@ -43,7 +43,11 @@ func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (et if ctx.config.DataDir == "" { return ethdb.NewMemDatabase() } - return ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles) + db, err := ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles) + if err != nil { + return nil, err + } + return db, nil } // ResolvePath resolves a user path into the data directory if that was relative