about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/unicorn.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 2093bb3..208e6da 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -495,7 +495,7 @@ module Unicorn
               # client closed the socket even before accept
               client.close rescue nil
             ensure
-              tempfile.chmod(nr += 1)
+              tempfile.chmod(nr += 1) if client
               break if nr < 0
             end
           end