From 22d6f1539b1962bef83c2263a9ebc9a3d8ca17bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Sun, 28 Apr 2019 17:06:03 +0200 Subject: [PATCH] Do not crash if LDAP group does not exist --- unipoly-mlmmj-ldap-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unipoly-mlmmj-ldap-sync b/unipoly-mlmmj-ldap-sync index 37767a1..d3f8d5c 100755 --- a/unipoly-mlmmj-ldap-sync +++ b/unipoly-mlmmj-ldap-sync @@ -156,7 +156,7 @@ def main filter = Net::LDAP::Filter.eq('cn', list_name) 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 puts 'NOT FOUND' else