From 0e064948cb99455768b896888593efd04346f183 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Thu, 10 Mar 2016 11:01:33 -0700 Subject: [PATCH] Adds check for a nil socket in Net::HTTP --- lib/ruby/1.9/net/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby/1.9/net/http.rb b/lib/ruby/1.9/net/http.rb index 2cf8c61d1..4cdcfed3a 100644 --- a/lib/ruby/1.9/net/http.rb +++ b/lib/ruby/1.9/net/http.rb @@ -1057,7 +1057,7 @@ def request(req, body = nil, &block) # :yield: +response+ res rescue => exception D "Conn close because of error #{exception}" - @socket.close unless @socket.closed? + @socket.close unless @socket.nil? || @socket.closed? raise exception end