From 943a291903fd3d4239f5e972f9205654b2120db4 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Thu, 11 Feb 2016 16:42:21 +0100 Subject: [PATCH] Do not blow up if the error is that a chain cannot be found --- storage/lvl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/lvl.js b/storage/lvl.js index 179d1fc73..18c604d93 100644 --- a/storage/lvl.js +++ b/storage/lvl.js @@ -3,8 +3,8 @@ var nThen = require('nthen'); var getIndex = function(db, cName, cb) { db.get(cName+'=>index', function(e, out){ - if (e) { throw e; } - cb(parseInt(out)); + if (e && !e.notFound) { throw e; } + cb(parseInt(out || 0)); }); };