diff --git a/src/hebg/call_graph.py b/src/hebg/call_graph.py index 28e24eb..a189620 100644 --- a/src/hebg/call_graph.py +++ b/src/hebg/call_graph.py @@ -64,7 +64,7 @@ def call_nodes( # Search for name reference in all_behaviors if node.name in heb_graph.all_behaviors: node = heb_graph.all_behaviors[node.name] - if not hasattr(node, "graph"): + if not hasattr(node, "_graph") or node._graph is None: action = node(observation) break self._extend_frontiere(node.graph.roots, heb_graph=node.graph) diff --git a/tests/test_call_graph.py b/tests/test_call_graph.py index 8958338..0cf048e 100644 --- a/tests/test_call_graph.py +++ b/tests/test_call_graph.py @@ -185,6 +185,7 @@ def build_graph(self) -> HEBGraph: return graph sub_behavior = SubBehavior() + sub_behavior.graph root_behavior = RootBehavior() root_behavior.graph.all_behaviors["SubBehavior"] = sub_behavior