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
This commit is contained in:
Florian Müllner 2012-10-23 14:32:27 +02:00
parent 599f2f43e3
commit a4e29e1244

View File

@ -270,8 +270,9 @@ const DBusEventSource = new Lang.Class({
this._loadEvents(false); this._loadEvents(false);
}, },
_onEventsReceived: function([appointments]) { _onEventsReceived: function(results, error) {
let newEvents = []; let newEvents = [];
let appointments = results ? results[0] : null;
if (appointments != null) { if (appointments != null) {
for (let n = 0; n < appointments.length; n++) { for (let n = 0; n < appointments.length; n++) {
let a = appointments[n]; let a = appointments[n];