fix(ldap): prevent panic if search error arise (#1216)

pull/1217/head
Anthony Lapenna 2017-09-20 20:58:09 +02:00 committed by GitHub
parent 09409804af
commit 601ae9daf2
1 changed files with 4 additions and 1 deletions

View File

@ -33,7 +33,10 @@ func searchUser(username string, conn *ldap.Conn, settings []portainer.LDAPSearc
// Deliberately skip errors on the search request so that we can jump to other search settings
// if any issue arise with the current one.
sr, _ := conn.Search(searchRequest)
sr, err := conn.Search(searchRequest)
if err != nil {
continue
}
if len(sr.Entries) == 1 {
found = true