diff --git a/lib/net/http.rb b/lib/net/http.rb index 01fcc5dbf..f0439fbec 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1189,7 +1189,7 @@ def transport_request(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