fix
This commit is contained in:
parent
6f976ed3a5
commit
5b325c4ae5
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user