diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index ae29ae1ed5..a2c0baf1e4 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -191,7 +191,7 @@ class TestSocket < Test::Unit::TestCase assert_equal(clients.length, accepted.length) ensure tcp_servers.each {|s| s.close if !s.closed? } - unix_server.close if !unix_server.closed? + unix_server.close if unix_server && !unix_server.closed? clients.each {|s| s.close if !s.closed? } accepted.each {|s| s.close if !s.closed? } end