Added check for situation where $User is null