Test current_view before using it

get_events callback may be called by fullcalendar before the screen has set
the current_view attribute.

issue6852
review38871002
This commit is contained in:
Cédric Krier committed 2017-10-21 10:41:12 +02:00
1 parent 73da7e8710
commit d2e668a6eb
1 file changed
+2 -1
+2 -1
View File
@@ -115,7 +115,8 @@
this.start = Sao.DateTime(start.utc());
this.end = Sao.DateTime(end.utc());
var prm = jQuery.when();
if (this.screen.current_view.view_type != 'form') {
if (this.screen.current_view &&
(this.screen.current_view.view_type != 'form')) {
var search_string = this.screen.screen_container.get_text();
prm = this.screen.search_filter(search_string);
}