File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
node-graph/preprocessor/src Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ pub fn expand_network(network: &mut NodeNetwork, substitutions: &HashMap<ProtoNo
1919 DocumentNodeImplementation :: Network ( node_network) => expand_network ( node_network, substitutions) ,
2020 DocumentNodeImplementation :: ProtoNode ( proto_node_identifier) => {
2121 if let Some ( new_node) = substitutions. get ( proto_node_identifier) {
22+ // Reconcile the document node's inputs with what the current node definition expects,
23+ // since the saved document may have fewer or more inputs than the current version
24+ while node. inputs . len ( ) < new_node. inputs . len ( ) {
25+ node. inputs . push ( new_node. inputs [ node. inputs . len ( ) ] . clone ( ) ) ;
26+ }
27+ node. inputs . truncate ( new_node. inputs . len ( ) ) ;
28+
2229 node. implementation = new_node. implementation . clone ( ) ;
2330 }
2431 }
You can’t perform that action at this time.
0 commit comments