Prevent null pointer exception when checking if a user exists