fix javascript error "no method indexOf of undefined"

This commit is contained in:
Ralf Becker 2014-10-06 09:57:50 +00:00
parent d3cde1efb4
commit 1b9865bbbf

View File

@ -674,9 +674,8 @@ app.classes.mail = AppJS.extend(
var remembervalue = ''; var remembervalue = '';
for(var i = 0; i < content.length; i++) for(var i = 0; i < content.length; i++)
{ {
if (typeof content[i] != 'string' || !content[i]) continue;
// if there is no @ in string, its most likely that we have a comma in the personal name part of the emailaddress // if there is no @ in string, its most likely that we have a comma in the personal name part of the emailaddress
if (content[i] != 'undefined' && content[i])
{
if (content[i].indexOf('@')< 0) if (content[i].indexOf('@')< 0)
{ {
remembervalue = content[i]; remembervalue = content[i];
@ -690,7 +689,6 @@ app.classes.mail = AppJS.extend(
} }
} }
} }
}
else else
{ {
widget.set_value({content: content}); widget.set_value({content: content});