summaryrefslogtreecommitdiff
path: root/ext/socket/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 08:05:35 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 08:05:35 +0000
commit059c9c1cf371e049c7481c78b76e9620da52757f (patch)
treeb383b59a1a2761c5fa2110fdd7712e80f02d08ea /ext/socket/lib
parent6cf568f4b56dcafc5c0fe84df2c0d2491fb0c62b (diff)
* ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz * lib/drb/extservm.rb: ditto. * lib/net/http.rb: ditto. * lib/net/http/response.rb: ditto. * lib/scanf.rb: ditto. * lib/uri/generic.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/lib')
-rw-r--r--ext/socket/lib/socket.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 31dc596..5c3ed40 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -1102,7 +1102,7 @@ class Socket < BasicSocket
st = File.lstat(path)
rescue Errno::ENOENT
end
- if st && st.socket? && st.owned?
+ if st&.socket? && st.owned?
File.unlink path
end
end