From 464c0f27fbe1a0698275a6ab13b56b3ef39b5f57 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 2 Apr 2014 20:20:49 +0000 Subject: [PATCH] Make sure quotabox is there before using it --- mail/js/app.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 4546941033..298655e8b2 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -794,11 +794,15 @@ app.classes.mail = AppJS.extend( { //this.et2 should do the same as etemplate2.getByApplication('mail')[0].widgetContainer var quotabox = this.et2.getWidgetById(this.nm_index+'[quotainpercent]'); - //console.log(_data,quotabox); - //try to set it via set_value and set label - this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_class(_data.data.quotaclass); - this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_value(_data.data.quotainpercent); - this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_label(_data.data.quota); + + // Check to make sure it's there + if(quotabox) + { + //try to set it via set_value and set label + quotabox.set_class(_data.data.quotaclass); + quotabox.set_value(_data.data.quotainpercent); + quotabox.set_label(_data.data.quota); + } }, /**