Skip to content

Commit

Permalink
fix: add none check to conneted_on...
Browse files Browse the repository at this point in the history
  • Loading branch information
antonykamp committed Apr 18, 2023
1 parent ed4e588 commit d5e7a59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yaramo/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ def connected_nodes(self):

@property
def connected_on_head(self):
if self.connected_edge_on_head is None:
return None
return self.connected_edge_on_head.get_opposite_node(self)

@property
def connected_on_left(self):
if self.connected_edge_on_left is None:
return None
return self.connected_edge_on_left.get_opposite_node(self)

@property
def connected_on_right(self):
if self.connected_edge_on_right is None:
return None
return self.connected_edge_on_right.get_opposite_node(self)

def set_connection_head_edge(self, edge: "Edge"):
Expand Down

0 comments on commit d5e7a59

Please sign in to comment.