Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Sup crashes when loading a message
@ 2011-12-23 15:31 Alex Shulgin
  0 siblings, 0 replies; only message in thread
From: Alex Shulgin @ 2011-12-23 15:31 UTC (permalink / raw)
  To: sup-talk

Got this crash today:

--- NoMethodError from thread: periodic poll
undefined method `downcase' for nil:NilClass
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/rmail-1.0.0/lib/rmail/header.rb:537:in
`content_type'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/message.rb:427:in
`message_to_chunks'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/message.rb:427:in
`map'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/message.rb:427:in
`message_to_chunks'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/message.rb:259:in
`load_from_source!'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/message.rb:328:in
`build_from_source'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:158:in
`poll_from'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/mbox.rb:143:in
`poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:155:in
`poll_from'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:113:in
`do_poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:103:in
`each'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:103:in
`do_poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:102:in
`synchronize'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:102:in
`do_poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/util.rb:609:in
`send'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/util.rb:609:in
`method_missing'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/modes/poll-mode.rb:15:in
`poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:49:in
`poll_with_sources'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:68:in `poll'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:86:in
`start'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup.rb:78:in
`reporting_thread'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup.rb:76:in
`initialize'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup.rb:76:in `new'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup.rb:76:in
`reporting_thread'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/poll.rb:83:in
`start'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/util.rb:609:in
`send'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/lib/sup/util.rb:609:in
`method_missing'
/home/ash/.rvm/gems/ruby-1.8.7-p352/gems/sup-0.12.1/bin/sup:222
/home/ash/.rvm/gems/ruby-1.8.7-p352/bin/sup:19:in `load'
/home/ash/.rvm/gems/ruby-1.8.7-p352/bin/sup:19

Seems like rmail doesn't really like an empty "Content-Type: " header:

rmail/header.rb:
    def content_type(default = nil)
      if value = self['content-type']
	value.strip.split(/\s*;\s*/)[0].downcase  # <== crashes on value=""
      else
	if block_given?
          yield
        else
          default
        end
      end
    end

Adding (... || "") before downcase seems to help this crash.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


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

only message in thread, other threads:[~2011-12-23 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-23 15:31 [sup-talk] Sup crashes when loading a message Alex Shulgin

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