]> git.cworth.org Git - sup/commitdiff
fix normalize_whitespace error where rubymail is breaking
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 7 Nov 2007 20:19:04 +0000 (20:19 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 7 Nov 2007 20:19:04 +0000 (20:19 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@677 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message.rb

index a899165baf101c6680a1ea8ebd06f2f157f6d3de..5decdee998688ab5208dc29afbac524e82bce53b 100644 (file)
@@ -361,11 +361,11 @@ private
   end
 
   def self.convert_from body, charset
-    return body unless charset
-
     begin
+      raise MessageFormatError, "RubyMail decode returned a null body" unless body
+      return body unless charset
       Iconv.iconv($encoding, charset, body).join
-    rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e
+    rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e
       Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}"
       File.open("sup-unable-to-decode.txt", "w") { |f| f.write body }
       body