Skip to content

Commit d7e638f

Browse files
committed
Prevent endless subordinate entity loops
1 parent 05240fc commit d7e638f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ofcli/fedtree.py

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ async def discover(self, http_session: aiohttp.ClientSession) -> None:
3737
entity_id=URL(sub), http_session=http_session
3838
)
3939
)
40+
if subordinate.entity.get('sub') == self.entity.get('sub'):
41+
raise InternalException(f"Entity is listed as its own subordinate.")
4042
await subordinate.discover(http_session)
4143
# logger.debug(f"Adding subordinate {subordinate.entity.get('sub')}")
4244
# logger.debug(f"{subordinate.entity}")

0 commit comments

Comments
 (0)