From de72095f46aa7506bcdd49063a1e9e87169b7fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernst=20W=C3=BCrger?= Date: Wed, 19 Jun 2024 08:27:30 +0200 Subject: [PATCH] fix(context-diagram): Make port processing more secure (#110) --- capellambse_context_diagrams/collectors/default.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/capellambse_context_diagrams/collectors/default.py b/capellambse_context_diagrams/collectors/default.py index 91d5c6ac..5f320c6e 100644 --- a/capellambse_context_diagrams/collectors/default.py +++ b/capellambse_context_diagrams/collectors/default.py @@ -176,13 +176,10 @@ def _process_ports(self, stack_heights: dict[str, float | int]) -> None: while ( current and current.uuid not in self.diagram_target_owners - and hasattr(current, "owner") + and getattr(current, "owner", None) is not None and not isinstance(current.owner, generic.PackageTypes) ): - current = self._make_owner_box( - self.diagram, - current, - ) + current = self._make_owner_box(self.diagram, current) self.common_owners.add(current.uuid) stack_heights[side] += makers.NEIGHBOR_VMARGIN + height