From 2eff897d522c7b787f7bcc7adfc127fc9d124f7e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 3 Feb 2014 16:41:10 +0000 Subject: [PATCH] Make sure this.et2 is there before trying to use it. Fixes type error when closing un-viewed mail tab. --- mail/js/app.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 08f3e7c458..8f92e257a5 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -69,12 +69,14 @@ app.classes.mail = AppJS.extend( destroy: function() { // Unbind from nm refresh - var nm = this.et2.getWidgetById('nm'); - if(nm != null) + if(this.et2 != null) { - $j(nm).off('refresh'); + var nm = this.et2.getWidgetById('nm'); + if(nm != null) + { + $j(nm).off('refresh'); + } } - delete this.et2; delete this.et2_obj; // call parent this._super.apply(this, arguments); @@ -92,7 +94,6 @@ app.classes.mail = AppJS.extend( // call parent; somehow this function is called more often. (twice on a display and compose) why? this._super.apply(this, arguments); this.et2_obj = et2; - this.et2 = et2.widgetContainer; var isMainView = false; var isDisplay = false; var isCompose = false;