]> git.cworth.org Git - sup/commitdiff
imap bugfix: out of sync source throws an exception (thanks to Ian Taylor)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 19:32:14 +0000 (19:32 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sat, 27 Oct 2007 19:32:14 +0000 (19:32 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@627 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/imap.rb

index 4cc7b2edd9cf2156dcc11ca59318c31d96c17626..c74b0e5bd90fa0cd0df78ceef784641334679983 100644 (file)
@@ -270,8 +270,9 @@ private
   end
 
   def get_imap_fields id, *fields
-    imap_id = @imap_state[id][:id] or raise OutOfSyncSourceError, "Unknown message id #{id}"
+    raise OutOfSyncSourceError, "Unknown message id #{id}" unless @imap_state[id]
 
+    imap_id = @imap_state[id][:id]
     result = fetch(imap_id, (fields + ['RFC822.SIZE', 'INTERNALDATE']).uniq).first
     got_id = make_id result
     raise OutOfSyncSourceError, "IMAP message mismatch: requested #{id}, got #{got_id}." unless got_id == id