Do not crash if LDAP group does not exist
This commit is contained in:
parent
42c1558714
commit
22d6f1539b
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ def main
|
||||||
|
|
||||||
filter = Net::LDAP::Filter.eq('cn', list_name)
|
filter = Net::LDAP::Filter.eq('cn', list_name)
|
||||||
matched_ldap_groups = conn.search(base: basetree, filter: filter)
|
matched_ldap_groups = conn.search(base: basetree, filter: filter)
|
||||||
if matched_ldap_groups.empty?
|
if matched_ldap_groups.nil? || matched_ldap_groups.empty?
|
||||||
# Could not find matching LDAP group
|
# Could not find matching LDAP group
|
||||||
puts 'NOT FOUND'
|
puts 'NOT FOUND'
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue