diff --git a/mail/js/app.js b/mail/js/app.js index f56d4350be..f35ff4ef98 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -5609,10 +5609,15 @@ app.classes.mail = AppJS.extend( spamTitan_setActionTitle: function (_action, _sender) { var id = _sender[0].id != 'nm'? _sender[0].id:_sender[1].id; + var email = this.egw.lang('emails'); + var domain = this.egw.lang('domains'); var data = egw.dataGetUIDdata(id); - var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/); - var email = _sender.length>1? this.egw.lang('emails'):(fromaddress && fromaddress[1]) ?fromaddress[1]:data.data.fromaddress; - var domain = _sender.length>1? this.egw.lang('domains'):email.split('@')[1]; + if(_sender.length === 1 && data && data.data && data.data.fromaddress) + { + var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/); + email = (fromaddress && fromaddress[1]) ?fromaddress[1]:data.data.fromaddress; + domain = email.split('@')[1]; + } switch (_action.id) { case 'whitelist_email_add':