This commit is contained in:
sora 2019-10-23 11:11:35 +02:00
parent 6f976ed3a5
commit 5b325c4ae5

View File

@ -21,7 +21,10 @@ module.exports = function(name){
this.init = function(){ this.init = function(){
fs.readFile(this.file, (err, data) => { fs.readFile(this.file, (err, data) => {
if (err) throw err; if (err.errno==-2 && err.code == "ENOENT"){
this.set(db);
return;
}else if (err) throw err;
this.json = JSON.parse(data); this.json = JSON.parse(data);
}); });
} }