Another null pointer fix for ldap support