mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-03-21 17:54:13 -05:00
Fix bug with invalid data on disk
This commit is contained in:
parent
eb7aa11245
commit
60c61e6231
|
|
@ -137,15 +137,13 @@ export default class FestivalUpdater extends DataUpdater
|
|||
|
||||
async _formatDataForWrite(data) {
|
||||
// Combine this region's data with the other regions' data.
|
||||
let result = null;
|
||||
let result = {};
|
||||
try {
|
||||
result = await fs.readFile(this.getPath(this.filename));
|
||||
} catch (e) {
|
||||
result = JSON.parse(await fs.readFile(this.getPath(this.filename)));
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
|
||||
result = result ? JSON.parse(result) : {};
|
||||
|
||||
result[this.region] = data;
|
||||
|
||||
return super.formatDataForWrite(result);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user