Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: joe@talkhouse.com (Joe Wölfel)
Subject: [sup-talk] [PATCH] Hack that fixes "undefined method multipart?" exception.
Date: Fri, 19 Jun 2009 12:23:23 -0400	[thread overview]
Message-ID: <1245428166-sup-5693@joe-wolfels-power-mac-g5.local> (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


                 reply	other threads:[~2009-06-19 16:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245428166-sup-5693@joe-wolfels-power-mac-g5.local \
    --to=joe@talkhouse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox