]> git.notmuchmail.org Git - sup/commitdiff
bugfix: poll.rb assuming all messages have froms
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 4 May 2009 12:37:04 +0000 (05:37 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Mon, 4 May 2009 12:41:23 +0000 (05:41 -0700)
This was throwing an exception, so now it's protected. The from is only
necessary for the after-poll hook.

lib/sup/poll.rb

index d766587f58815f27ec07b485c07ca6ec5204542a..5027218c49d66318b309a062c1d222d81699d3a1 100644 (file)
@@ -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