FIX: fail to send email notification if post has img tag with no src attribute

This commit is contained in:
Neil Lalonde
2017-06-15 10:36:11 -04:00
parent cc525b1a8d
commit eb9f306e64
2 changed files with 10 additions and 1 deletions

View File

@ -191,8 +191,10 @@ module Email
def strip_avatars_and_emojis
@fragment.search('img').each do |img|
next unless img['src']
if img['src'][/_avatar/]
img.parent['style'] = "vertical-align: top;" if img.parent.name == 'td'
img.parent['style'] = "vertical-align: top;" if img.parent&.name == 'td'
img.remove
end