ensure username variable is not None before checking if profilephp in it

The current master version breaks on registration attempts because it tries to perform a check to see if profilephp is in username without ensuring username is not None.