wmorgan / heliotrope

A personal, threaded, search-centric email server.
124 stars 17 forks source link

Check return value of @imap.uid_fetch #6

Closed kljohann closed 13 years ago

kljohann commented 13 years ago

It seems uid_fetch will return nil in some cases leading to errors of the following form:

/tmp/heliotrope/lib/heliotrope/imap-dumper.rb:191:in `next_message': undefined method `size' for nil:NilClass (NoMethodError)
from bin/heliotrope-add:127:in `<main>'

I changed

imapdata = begin
  @imap.uid_fetch query, imap_query_columns

to

imapdata = begin
    (@imap.uid_fetch query, imap_query_columns) or []

But I don't know if this is the right fix to apply (I did not read the documentation of net/imap yet).