[IMP] tools: mail: added a protection in a string.find, could have a None argument
bzr revid: tde@openerp.com-20131022142908-sol44xaprx1b0b0a
This commit is contained in:
parent
af29bf7bc9
commit
57c11338ae
|
@ -195,7 +195,10 @@ def html_email_clean(html, remove=False, shorten=False, max_length=300):
|
|||
cur_char_nbr += len(word)
|
||||
if cur_char_nbr >= position:
|
||||
break
|
||||
stop_idx = node.text.find(word) + len(word)
|
||||
if word:
|
||||
stop_idx = node.text.find(word) + len(word)
|
||||
else:
|
||||
stop_idx = len(node.text)
|
||||
if stop_idx == -1:
|
||||
stop_idx = len(node.text)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue