mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
various fixes
This commit is contained in:
1 parent
a0984782a8
commit
466a4fbd8b
9 files changed
+54
-11
No files matched your search
@@ -19,7 +19,10 @@ class JSONDB {
|
||||
}
|
||||
|
||||
connect () {
|
||||
let data = JSON.parse( fs.readFileSync( path.join( __dirname + '/data/db.json' ) ) );
|
||||
let data = {};
|
||||
try {
|
||||
JSON.parse( fs.readFileSync( path.join( __dirname + '/data/db.json' ) ) );
|
||||
} catch ( err ) {}
|
||||
this.db = data[ 'db' ] ?? { 'libreevent_temp': {}, 'libreevent_admin': {}, 'libreevent_orders': {}, 'libreevent_users': {} };
|
||||
this.dbIndex = data[ 'index' ] ?? { 'libreevent_temp': 0, 'libreevent_admin': 0, 'libreevent_orders': 0, 'libreevent_users': 0 };
|
||||
this.db[ 'libreevent_temp' ] = {};
|
||||
|
||||
Reference in new issue
Block a user