Do not blow up if the error is that a chain cannot be found

pull/1/head
Caleb James DeLisle 2016-02-11 16:42:21 +01:00
parent a7da21ccba
commit 943a291903
1 changed files with 2 additions and 2 deletions

View File

@ -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));
});
};