[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] heliotrope: Crash with empty message.recipients



I noticed that heliotrope-add bangs out on message
<E1JZvDB-0000vf-17@faramir.fjphome.nl> from the debian-vote list:
http://lists.debian.org/debian-vote/2008/03/msg00130.html

# ruby1.9.1 -Ilib ./bin/heliotrope-add -m debian-vote-2008 -d test
/home/test/GIT/heliotrope/lib/heliotrope/index.rb:482:in `block in index!': undefined method `indexable_text' for nil:NilClass (NoMethodError)
    from /home/test/GIT/heliotrope/lib/heliotrope/index.rb:482:in `map'
    from /home/test/GIT/heliotrope/lib/heliotrope/index.rb:482:in `index!'
    from /home/test/GIT/heliotrope/lib/heliotrope/index.rb:80:in `add_message'
    from ./bin/heliotrope-add:113:in `<main>'

As you can see even in the HTML representation of the message linked
above:

    To: , debian-vote@lists.debian.org

This code in line 482 of lib/heliotrope/index.rb will fail work if any
recipient is empty:

    message.recipients.map { |x| x.indexable_text }.join(" ").downcase

Sadly, I'm lacking the Ruby skills to make heliotrope cope with such
pathological messages. In Python, I would fix it like this:

    [x.indexable_text for x in message.recipients if x]

Regards,
    Gregor
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel