Skip to content

Commit

Permalink
Fix HardwareLayout.cac() for case where node has no component
Browse files Browse the repository at this point in the history
  • Loading branch information
anschweitzer committed Sep 25, 2024
1 parent d925d56 commit 8972940
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gwproto/data_classes/hardware_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ def component(self, node_alias: str) -> Optional[Component]:
return self.component_from_node(self.node(node_alias, None))

def cac(self, node_alias: str) -> Optional[ComponentAttributeClassGt]:
return self.component(node_alias).cac
component = self.component(node_alias)
if component is None:
return None
return component.cac

def get_component_as_type(self, component_id: str, type_: Type[T]) -> Optional[T]:
component = self.components.get(component_id, None)
Expand Down

0 comments on commit 8972940

Please sign in to comment.