From de1a8c3cb880d29bcf12d10e52985ff733c6a439 Mon Sep 17 00:00:00 2001 From: sora Date: Wed, 23 Oct 2019 11:12:09 +0200 Subject: [PATCH] fix --- jsondb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsondb.js b/jsondb.js index 02f8d03..24b45ab 100644 --- a/jsondb.js +++ b/jsondb.js @@ -21,7 +21,7 @@ module.exports = function(name){ this.init = function(){ fs.readFile(this.file, (err, data) => { - if (err.errno==-2 && err.code == "ENOENT"){ + if (err && err.errno==-2 && err.code == "ENOENT"){ this.set(db); return; }else if (err) throw err;