Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Hack that fixes "undefined method multipart?" exception.
@ 2009-06-19 16:23 Joe Wölfel
  0 siblings, 0 replies; only message in thread
From: Joe Wölfel @ 2009-06-19 16:23 UTC (permalink / raw)


On sup-sync -c I kept getting an exception on line 372 of message.rb in the
message_to_chunks function.  The cause was that 'm' was supposed to be a
message that needed to be converted to chunks.  Instead, it was
aRedwood::Chunk::CryptoNotice, which didn't have a mulitipart? method.  So it
crashed on "if m.multipart?".  My assumption is that a
Redwood::Chunk::CryptoNotice is already a chunk and doesn't need to be
converted.  So my solution is just to return it.  That fixes the bug.  But
probably there is a more sensible fix.  Possibly m should never have been a
chunk in the first place.
---
 lib/sup/message.rb |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/sup/message.rb b/lib/sup/message.rb
index ded577a..caf0cdb 100644
--- a/lib/sup/message.rb
+++ b/lib/sup/message.rb
@@ -369,6 +369,11 @@ private
 
   ## takes a RMail::Message, breaks it into Chunk:: classes.
   def message_to_chunks m, encrypted=false, sibling_types=[]
+    ## TODO: Replace the following four lines with something more sensible.
+    unless m.respond_to? :multipart?
+      puts "I bet this is a Redwood::Chunk::CryptoNotice: \n#{m.class}"
+      return m
+    end
     if m.multipart?
       chunks =
         case m.header.content_type
-- 
1.6.2.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-19 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19 16:23 [sup-talk] [PATCH] Hack that fixes "undefined method multipart?" exception Joe Wölfel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox