Skip to content

Commit adf6f3f

Browse files
committed
no nil dereference
1 parent 9ea6061 commit adf6f3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ldap/ldap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (l *Config) Clone() (cloned Config) {
9292

9393
func (l *Config) connect(ldapAddr string) (ldapConn *ldap.Conn, err error) {
9494
tls := l.TLS
95-
if tls.ServerName == "" {
95+
if tls != nil && tls.ServerName == "" {
9696
// Set the server name to the LDAP server address.
9797
colonPos := strings.LastIndex(ldapAddr, ":")
9898
if colonPos == -1 {

0 commit comments

Comments
 (0)