This condition should be outside of `if ($relation = $this->accessor->getValue($entity, $name)) {`, not inside