diff options
Diffstat (limited to 'python/flowgraph.py')
| -rw-r--r-- | python/flowgraph.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/flowgraph.py b/python/flowgraph.py index 3054ff35..58add8b0 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -268,8 +268,13 @@ class FlowGraphNode(object): :param BranchType edge_type: Type of edge to add :param FlowGraphNode target: Target node object """ + if not target.is_valid_for_graph(self.graph): + raise ValueError("Target of edge has not been added to the owning graph") core.BNAddFlowGraphNodeOutgoingEdge(self.handle, edge_type, target.handle) + def is_valid_for_graph(self, graph): + return core.BNIsNodeValidForFlowGraph(graph.handle, self.handle) + class FlowGraphLayoutRequest(object): def __init__(self, graph, callback = None): |
