diff --git a/birdvisu/topo_v3.py b/birdvisu/topo_v3.py index da7eb8c..32126ab 100644 --- a/birdvisu/topo_v3.py +++ b/birdvisu/topo_v3.py @@ -78,6 +78,7 @@ class TopologyV3: def add_edge(self, edge): if self.frozen: raise ValueError('Cannot add edge to frozen topology.') + if edge.count <= 0: raise ValueError('Must not add non-existent edges') # We need to merge relevant edges. Thus, this is more like adding a # multi-edge, which falls to no-op when the specific edge is already # present. In other words, this means that we _may_ have multiple Edge