summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-03-06 11:56:15 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-03-06 11:56:27 (GMT)
commit2247e46163c888a5539883afb360a5974c495892 (patch)
tree5fe80ad0b341404cab473dd9b2199aec3e3afb84
parent8b7f116b848d80de6b35806935f9989a7dcddda9 (diff)
downloadroundcubemail-plugins-kolab-2247e46163c888a5539883afb360a5974c495892.tar.gz
Avoid javascript errors while free/busy data isn't fully loaded
-rw-r--r--plugins/calendar/calendar_ui.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index b721b5b..583f831 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -1234,6 +1234,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(),