Get IMAP#fetch and #uid_fetch to always return an array.

I wasn't aware enough that Net::IMAP#fetch_internal may return nil. We
have a dedicated subclass of Net::IMAP, so override the behavior there.

Fixes #602.

Akinori MUSHA 10 ans auparavant
Parent
Commettre
89a7848c80
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      app/models/agents/imap_folder_agent.rb

+ 8 - 0
app/models/agents/imap_folder_agent.rb

@@ -453,6 +453,14 @@ module Agents
453 453
         ret
454 454
       end
455 455
 
456
+      def fetch(*args)
457
+        super || []
458
+      end
459
+
460
+      def uid_fetch(*args)
461
+        super || []
462
+      end
463
+
456 464
       def uid_fetch_mails(set)
457 465
         uid_fetch(set, 'RFC822.HEADER').map { |data|
458 466
           Message.new(self, data, folder: @folder, uidvalidity: @uidvalidity)