Skip to content

Commit c4c0489

Browse files
committed
eventView.js: (minor) Fix possible undefined argument for
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
1 parent 2aa91fc commit c4c0489

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

files/usr/share/cinnamon/applets/[email protected]/eventView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ class EventsManager {
405405
}
406406

407407
if (any_removed) {
408-
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()]);
408+
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()] || null);
409409
this.emit("events-updated");
410410
}
411411

@@ -445,7 +445,7 @@ class EventsManager {
445445
}
446446

447447
if (changed) {
448-
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()]);
448+
this._event_list.set_events(this.events_by_date[this.current_selected_date.to_unix()] || null);
449449
}
450450

451451
this._start_gc_timer();

0 commit comments

Comments
 (0)