Guard a call for `scrub` with try()

This addresses #842.

Akinori MUSHA 9 years ago
parent
commit
1e57f3a457
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/agents/imap_folder_agent.rb

+ 1 - 1
app/models/agents/imap_folder_agent.rb

@@ -509,7 +509,7 @@ module Agents
509 509
       module Scrubbed
510 510
         def scrubbed(method)
511 511
           (@scrubbed ||= {})[method.to_sym] ||=
512
-            __send__(method).scrub { |bytes| "<#{bytes.unpack('H*')[0]}>" }
512
+            __send__(method).try(:scrub) { |bytes| "<#{bytes.unpack('H*')[0]}>" }
513 513
         end
514 514
       end
515 515