Fix null ref error in get_effective_instance_user

The function was assuming that the argument was not None.