diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-06-06 12:23:19 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-06-06 12:24:55 +0100 |
commit | 895fffedf54ae9ea4168cf03ca5aa55f93a93b49 (patch) | |
tree | cd9c024604f4b95a73e61e41be952efd9668b61e /lib | |
parent | 6f415fca07b438e4d4ca84e7c2efdee62db8ce48 (diff) |
Handle converting empty RTF fileshotfix/0.18.0.3
Fixes https://github.com/mysociety/alaveteli/issues/1563
Diffstat (limited to 'lib')
-rw-r--r-- | lib/attachment_to_html/adapters/rtf.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/attachment_to_html/adapters/rtf.rb b/lib/attachment_to_html/adapters/rtf.rb index 859c0e541..95f499689 100644 --- a/lib/attachment_to_html/adapters/rtf.rb +++ b/lib/attachment_to_html/adapters/rtf.rb @@ -73,6 +73,8 @@ module AttachmentToHTML # Works around http://savannah.gnu.org/bugs/?42015 in unrtf ~> 0.21 def sanitize_converted(html) + html.nil? ? html = '' : html + invalid = %Q(<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>) valid = %Q(<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN>") if html.include?(invalid) |