Check for return value null before accessing object

* fixes a blank page on login if something with LDAP is broken and null instead of the user is returned