Brozy123 commited on
Commit
a476e1b
·
verified ·
1 Parent(s): 7acb589

Update storage.js

Browse files
Files changed (1) hide show
  1. storage.js +3 -2
storage.js CHANGED
@@ -10,7 +10,7 @@ class Storage {
10
  settings: path.join(this.dir, 'settings.json'),
11
  roles: path.join(this.dir, 'roles.json'),
12
  stats: path.join(this.dir, 'stats.json'),
13
- polls: path.join(this.dir, 'active_polls.json'),
14
  records: path.join(this.dir, 'records.json')
15
  };
16
 
@@ -40,7 +40,8 @@ class Storage {
40
 
41
  save(key) {
42
  if (this.files[key]) {
43
- fs.writeFileSync(this.files[key], JSON.stringify(this.data[key], null, 2));
 
44
  }
45
  }
46
 
 
10
  settings: path.join(this.dir, 'settings.json'),
11
  roles: path.join(this.dir, 'roles.json'),
12
  stats: path.join(this.dir, 'stats.json'),
13
+ active_polls: path.join(this.dir, 'active_polls.json'),
14
  records: path.join(this.dir, 'records.json')
15
  };
16
 
 
40
 
41
  save(key) {
42
  if (this.files[key]) {
43
+ const output = this.data[key] || {};
44
+ fs.writeFileSync(this.files[key], JSON.stringify(output, null, 2));
45
  }
46
  }
47