Commit 2bfa02bb authored by Jacob Vosmaer's avatar Jacob Vosmaer

Check for errors in Adapter#dn_matches_filter?

parent 401cac62
......@@ -107,7 +107,12 @@ module Gitlab
end
def dn_matches_filter?(dn, filter)
ldap.search(base: dn, filter: filter, attributes: %w{dn}).any?
results = ldap.search(base: dn, filter: filter, attributes: %w{dn})
if results.nil?
false # Net::LDAP encountered an LDAP error
else
results.any?
end
end
private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment