From 895fffedf54ae9ea4168cf03ca5aa55f93a93b49 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 6 Jun 2014 12:23:19 +0100 Subject: Handle converting empty RTF files Fixes https://github.com/mysociety/alaveteli/issues/1563 --- lib/attachment_to_html/adapters/rtf.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/attachment_to_html') 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() valid = %Q(") if html.include?(invalid) -- cgit v1.2.3