Skip to content

Commit 44ef123

Browse files
adamgerhantKeavon
authored andcommitted
Fix traversal over primary
1 parent c1ac787 commit 44ef123

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

editor/src/messages/portfolio/document/utility_types/network_interface.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4235,6 +4235,12 @@ impl NodeNetworkInterface {
42354235
if !delete_nodes.contains(downstream_id) || (*input_index == 0 && self.is_layer(downstream_id, network_path)) {
42364236
stack.push(*downstream_id);
42374237
}
4238+
// If the traversal reaches the primary input of the node to delete then do not delete it
4239+
if node_id == downstream_id && *input_index == 0 {
4240+
can_delete = false;
4241+
stack = Vec::new();
4242+
break;
4243+
}
42384244
}
42394245
// If the traversal reaches the export, then the current node is not a sole dependent and cannot be deleted
42404246
else {

0 commit comments

Comments
 (0)