Prevent attempting to update SplatNet 3 data for presence if not configured

How can this happen??
This commit is contained in:
Samuel Elliott 2022-09-23 20:36:18 +01:00
parent 0d3ca779e0
commit 29b8923c5b
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -97,6 +97,11 @@ export default class SplatNet3Monitor extends EmbeddedLoop {
}
async update() {
if (!this.config) {
debug('Not updating SplatNet 3 monitor - not configured');
return this.disable();
}
const friends = this.cached_friends ?? await this.splatnet?.getFriendsRefetch();
this.cached_friends = null;
@ -108,7 +113,7 @@ export default class SplatNet3Monitor extends EmbeddedLoop {
this.regular_schedule = this.getSchedule(this.cached_schedules?.data.regularSchedules.nodes ?? []);
if (!this.regular_schedule) {
this.cached_schedules = await this.splatnet!.getSchedules();
this.cached_schedules = await this.splatnet?.getSchedules() ?? null;
this.regular_schedule = this.getSchedule(this.cached_schedules?.data.regularSchedules.nodes ?? []);
}