Guard a call for `scrub` with try()

This addresses #842.

Akinori MUSHA %!s(int64=9) %!d(string=hace) años
padre
commit
1e57f3a457
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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