diff --git a/lib/portus/ldap.rb b/lib/portus/ldap.rb index 92b127989..6303cf914 100644 --- a/lib/portus/ldap.rb +++ b/lib/portus/ldap.rb @@ -232,7 +232,7 @@ def guess_email return nil if cfg.nil? || !cfg["enabled"] record = @ldap.search(search_options) - return nil if record.size != 1 + return nil if record.blank? || record.size != 1 record = record.first cfg["attr"].empty? ? guess_from_dn(record["dn"]) : guess_from_attr(record, cfg["attr"])