From 9da0b4c9e255b8eb8dad45e501255e3378f4c9df Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 12 Feb 2014 13:10:04 +0000 Subject: [PATCH] harden CheckFolderNoSelect to ensure that we are ablen to enter tree context --- mail/js/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index c9d0617804..e1ae267fc5 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -863,13 +863,17 @@ app.classes.mail = AppJS.extend( * @param _senders - the representation of the tree leaf to be manipulated */ mail_CheckFolderNoSelect: function(action,_senders,_currentNode) { - console.log(action,_senders,_currentNode); + //console.log(action,_senders,_currentNode); // Abort if user selected an un-selectable node // Use image over anything else because...? - var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]'); - var node = ftree.getNode(_senders[0].id); + var ftree, node; + ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]'); + if (ftree) + { + node = ftree.getNode(_senders[0].id); + } - if (node.im0.indexOf('NoSelect') !== -1) + if (node && node.im0.indexOf('NoSelect') !== -1) { //ftree.reSelectItem(_previous); return false;