Make sure the user object is not null - see previous commits.