]> git.cworth.org Git - sup/commitdiff
handle weird rubymail error where body is nil in attachment parsing
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 01:03:10 +0000 (01:03 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 28 Oct 2007 01:03:10 +0000 (01:03 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@634 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message-chunks.rb

index 6da21aac4629fa1da44cdd4873e7a30b40d8e510..477ba6412b478391c64f73f4689ecae7ad44526a 100644 (file)
@@ -49,7 +49,12 @@ EOS
     def initialize content_type, filename, encoded_content, sibling_types
       @content_type = content_type
       @filename = filename
-      @raw_content = encoded_content.decode
+      @raw_content =
+        if encoded_content.body
+          encoded_content.decode
+        else
+          "For some bizarre reason, RubyMail was unable to parse this attachment.\n"
+        end
 
       @lines =
         case @content_type