diff --git a/sphinx_needs/data.py b/sphinx_needs/data.py index d3de0d38c..2d0704bc1 100644 --- a/sphinx_needs/data.py +++ b/sphinx_needs/data.py @@ -702,10 +702,10 @@ def __init__(self, env: BuildEnvironment) -> None: @property def _env_needs(self) -> dict[str, NeedsInfoType]: try: - return self.env.needs_all_needs + return self.env._needs_all_needs except AttributeError: - self.env.needs_all_needs = {} - return self.env.needs_all_needs + self.env._needs_all_needs = {} + return self.env._needs_all_needs def has_need(self, need_id: str) -> bool: """Check if a need with the given ID exists."""