* Mail - avoid javascript error blocking context menu from SpamTitan check when row data not found

This commit is contained in:
nathangray 2018-05-17 09:18:29 -06:00
parent 8fb30b8ce4
commit 29dcccc6e4

View File

@ -5609,10 +5609,15 @@ app.classes.mail = AppJS.extend(
spamTitan_setActionTitle: function (_action, _sender) spamTitan_setActionTitle: function (_action, _sender)
{ {
var id = _sender[0].id != 'nm'? _sender[0].id:_sender[1].id; 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 data = egw.dataGetUIDdata(id);
var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/); if(_sender.length === 1 && data && data.data && data.data.fromaddress)
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]; var fromaddress = data.data.fromaddress.match(/<([^\'\" <>]+)>$/);
email = (fromaddress && fromaddress[1]) ?fromaddress[1]:data.data.fromaddress;
domain = email.split('@')[1];
}
switch (_action.id) switch (_action.id)
{ {
case 'whitelist_email_add': case 'whitelist_email_add':