From ff6484bbbb4689ffc3842451276528492e3ba2f5 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 15 Apr 2014 11:57:15 +0000 Subject: [PATCH] if this.et2 is not defined, try to recover, if this fails, return silently and skip attempt to refresh quta/vacationnotice/filter/filter2 --- mail/js/app.js | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 2cf940ed0d..6bfb6c15c2 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -793,7 +793,18 @@ app.classes.mail = AppJS.extend( mail_setQuotaDisplay: function(_data) { //this.et2 should do the same as etemplate2.getByApplication('mail')[0].widgetContainer - if (!this.et2) this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + if (!this.et2) + { + try + { + this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + } + catch(e) + { + return; + } + } + var quotabox = this.et2.getWidgetById(this.nm_index+'[quotainpercent]'); // Check to make sure it's there @@ -826,7 +837,17 @@ app.classes.mail = AppJS.extend( //var vacationrange = this.et2.getWidgetById(this.nm_index+'[vacationrange]'); //console.log(_data,vacationnotice,vacationrange); //try to set it via set_value and set label - if (!this.et2) this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + if (!this.et2) + { + try + { + this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + } + catch(e) + { + return; + } + } if (_data == null) { this.et2.getWidgetById(this.nm_index+'[vacationnotice]').set_value(''); @@ -847,7 +868,17 @@ app.classes.mail = AppJS.extend( { //alert('mail_refreshFilter2Options'); if (_data == null) return; - if (!this.et2) this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + if (!this.et2) + { + try + { + this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + } + catch(e) + { + return; + } + } var filter2 = this.et2.getWidgetById('filter2'); var current = filter2.value; var currentexists=false; @@ -867,7 +898,17 @@ app.classes.mail = AppJS.extend( { //alert('mail_refreshFilterOptions'); if (_data == null) return; - if (!this.et2) this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + if (!this.et2) + { + try + { + this.et2 = etemplate2.getByApplication('mail')[0].widgetContainer; + } + catch(e) + { + return; + } + } var filter = this.et2.getWidgetById('filter'); var current = filter.value; var currentexists=false;