From a4e29e1244b097fc2bebc371e00d7af30537c376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 23 Oct 2012 14:32:27 +0200 Subject: [PATCH] calendar: Handle calendar-server errors The current code assumes that the GetEvents call will always receive, causing an exception in the error case. https://bugzilla.gnome.org/show_bug.cgi?id=686805 --- js/ui/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 7ee01cf51..3a3e73c66 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -270,8 +270,9 @@ const DBusEventSource = new Lang.Class({ this._loadEvents(false); }, - _onEventsReceived: function([appointments]) { + _onEventsReceived: function(results, error) { let newEvents = []; + let appointments = results ? results[0] : null; if (appointments != null) { for (let n = 0; n < appointments.length; n++) { let a = appointments[n];