Commit 4ffda78b authored by Stan Hu's avatar Stan Hu

Handle nil DNs

parent 69a28d5f
......@@ -98,7 +98,9 @@ module EE
# net-ldap only returns ASCII-8BIT and does not support UTF-8 out-of-the-box:
# https://github.com/ruby-ldap/ruby-net-ldap/issues/4
def clean_encoding(dn)
dn.force_encoding('UTF-8')
return dn unless dn.present?
dn.force_encoding('UTF-8')
rescue
dn
end
......
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