Skip to content
Browse files

Don't explode if idle isn't passed a block

  • Loading branch information...
1 parent e9392ca commit b13dee75471ef31b63e9bace72dc4ccc0ae79b08 @ConradIrwin ConradIrwin committed May 2, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/em-imap/client.rb
View
3 lib/em-imap/client.rb
@@ -351,8 +351,9 @@ def uid_copy(seq, mailbox)
# EM.timeout(60) { idler.stop }
#
def idle(&block)
- send_command("IDLE").listen(&block).tap do |command|
+ send_command("IDLE").tap do |command|
@connection.prepare_idle_continuation(command)
+ command.listen(&block) if block_given?
end
end

0 comments on commit b13dee7

Please sign in to comment.
Something went wrong with that request. Please try again.