calendar: Avoid a warning

We will always get a results array from gjs' proxy wrapper, but it
will be empty in the error case; that is, `results` is always defined,
but `results[0]` may not be.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
This commit is contained in:
Florian Müllner 2019-07-12 05:25:54 +02:00 committed by Georges Basile Stavracas Neto
parent 7d2c5c1ac9
commit c765082f72

View File

@ -237,7 +237,7 @@ var DBusEventSource = class DBusEventSource {
_onEventsReceived(results, error) {
let newEvents = [];
let appointments = results ? results[0] : null;
let appointments = results[0] || null;
if (appointments != null) {
for (let n = 0; n < appointments.length; n++) {
let a = appointments[n];