]> git.notmuchmail.org Git - sup/commitdiff
minor bugfix: rubymail sometimes returns a nil content_type
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 17 May 2009 19:31:36 +0000 (12:31 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 17 May 2009 19:31:36 +0000 (12:31 -0700)
lib/sup/message.rb

index 0ee46fb25d7ecbb97807910c9fa0785337bccc2c..b3c001e5cc64db42b49a6c070f7b270492d897b1 100644 (file)
@@ -423,7 +423,8 @@ private
         # Lowercase the filename because searches are easier that way 
         @attachments.push filename.downcase unless filename =~ /^sup-attachment-/
         add_label :attachment unless filename =~ /^sup-attachment-/
-        [Chunk::Attachment.new(m.header.content_type, filename, m, sibling_types)]
+        content_type = m.header.content_type || "application/unknown" # sometimes RubyMail gives us nil
+        [Chunk::Attachment.new(content_type, filename, m, sibling_types)]
 
       ## otherwise, it's body text
       else