Skip to content

Commit a37cc08

Browse files
Merge pull request #383 from railsstarter/topic/fix_for_undefined_method_write_for_nilclass
fix for undefined method for write exception
2 parents e3ff748 + b1eec43 commit a37cc08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/net/ldap/connection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def delete(args)
690690
#
691691
# Typically a TCPSocket, but can be a OpenSSL::SSL::SSLSocket
692692
def socket
693-
return @conn if defined? @conn
693+
return @conn if defined?(@conn) && !@conn.nil?
694694

695695
# First refactoring uses the existing methods open_connection and
696696
# prepare_socket to set @conn. Next cleanup would centralize connection

0 commit comments

Comments
 (0)