summaryrefslogtreecommitdiff
path: root/lib/net/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/http.rb')
-rw-r--r--lib/net/http.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index cd4d51071f..eba67916c6 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1056,7 +1056,7 @@ module Net #:nodoc:
end_transport req, res
rescue => exception
D "Conn close because of error #{exception}"
- @socket.close unless @socket.closed?
+ @socket.close if @socket and not @socket.closed?
raise exception
end