Skip to content

Commit

Permalink
eventView.js: (minor) Fix possible undefined argument for
Browse files Browse the repository at this point in the history
set_events().

The current selected date may not have any events, so set_events()
would receive 'undefined' for the first argument.

Observed in logs as:
... JS ERROR: TypeError: event_data_list is undefined
... [email protected]:757:13
... [email protected]:410:30

... JS LOG: [LookingGlass/warning] Invalid or null source id used when attempting to run Mainloop.source_remove()
... [email protected]:24:42
... [email protected]:167:20
... [email protected]:384:22
... [email protected]:390:14
... [email protected]:453:14
  • Loading branch information
mtwebster committed Jan 8, 2025
1 parent 2aa91fc commit c4c0489
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class EventsManager {
}

if (any_removed) {
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()]);
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()] || null);
this.emit("events-updated");
}

Expand Down Expand Up @@ -445,7 +445,7 @@ class EventsManager {
}

if (changed) {
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()]);
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()] || null);
}

this._start_gc_timer();
Expand Down

0 comments on commit c4c0489

Please sign in to comment.