From: William Morgan Date: Mon, 4 May 2009 12:37:04 +0000 (-0700) Subject: bugfix: poll.rb assuming all messages have froms X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d6aef055e73ff75603fa3f7ef0e4558e13442e5c;p=sup bugfix: poll.rb assuming all messages have froms This was throwing an exception, so now it's protected. The from is only necessary for the after-poll hook. --- diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index d766587..5027218 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -101,9 +101,9 @@ EOS yield "Found message at #{offset} with labels {#{m.labels * ', '}}" unless entry num += 1 - from_and_subj << [m.from.longname, m.subj] + from_and_subj << [m.from && m.from.longname, m.subj] if m.has_label?(:inbox) && ([:spam, :deleted, :killed] & m.labels).empty? - from_and_subj_inbox << [m.from.longname, m.subj] + from_and_subj_inbox << [m.from && m.from.longname, m.subj] numi += 1 end end