Skip to content

Commit bca22ea

Browse files
committed
Fix traversal over primary
1 parent ef30166 commit bca22ea

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
@@ -4242,6 +4242,12 @@ impl NodeNetworkInterface {
42424242
if !delete_nodes.contains(downstream_id) || (*input_index == 0 && self.is_layer(downstream_id, network_path)) {
42434243
stack.push(*downstream_id);
42444244
}
4245+
// If the traversal reaches the primary input of the node to delete then do not delete it
4246+
if node_id == downstream_id && *input_index == 0 {
4247+
can_delete = false;
4248+
stack = Vec::new();
4249+
break;
4250+
}
42454251
}
42464252
// If the traversal reaches the export, then the current node is not a sole dependent and cannot be deleted
42474253
else {

0 commit comments

Comments
 (0)