From f5cc6d26187a8fe3d1b4c1085bdc26fdb44d1b64 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 6 Mar 2013 12:56:15 +0100 Subject: [PATCH] Avoid javascript errors while free/busy data isn't fully loaded --- plugins/calendar/calendar_ui.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js index fd003da7..6a333e8b 100644 --- a/plugins/calendar/calendar_ui.js +++ b/plugins/calendar/calendar_ui.js @@ -1252,6 +1252,10 @@ function rcube_calendar_ui(settings) // attempt to find a time slot where all attemdees are available var freebusy_find_slot = function(dir) { + // exit if free-busy data isn't available yet + if (!freebusy_data || !freebusy_data.start) + return false; + var event = me.selected_event, eventstart = clone_date(event.start, event.allDay ? 1 : 0).getTime(), // calculate with integers eventend = clone_date(event.end, event.allDay ? 2 : 0).getTime(),