mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-28 08:46:55 -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) {
|
async _formatDataForWrite(data) {
|
||||||
// Combine this region's data with the other regions' data.
|
// Combine this region's data with the other regions' data.
|
||||||
let result = null;
|
let result = {};
|
||||||
try {
|
try {
|
||||||
result = await fs.readFile(this.getPath(this.filename));
|
result = JSON.parse(await fs.readFile(this.getPath(this.filename)));
|
||||||
} catch (e) {
|
} catch {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
result = result ? JSON.parse(result) : {};
|
|
||||||
|
|
||||||
result[this.region] = data;
|
result[this.region] = data;
|
||||||
|
|
||||||
return super.formatDataForWrite(result);
|
return super.formatDataForWrite(result);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user