From c765082f72d69ea2880f93cdb26466e310552cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 12 Jul 2019 05:25:54 +0200 Subject: [PATCH] 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 --- js/ui/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 3371004fc..01a56baee 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -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];