diff --git a/src/strands/ir_builders.js b/src/strands/ir_builders.js index 127d19e235..b9096d0f85 100644 --- a/src/strands/ir_builders.js +++ b/src/strands/ir_builders.js @@ -164,7 +164,7 @@ export function memberAccessNode(strandsContext, parentNode, componentNode, memb } export function structInstanceNode(strandsContext, structTypeInfo, identifier, dependsOn) { - const { cfg, dag, } = strandsContext; + const { cfg, dag } = strandsContext; if (dependsOn.length === 0) { for (const prop of structTypeInfo.properties) { const typeInfo = prop.dataType; @@ -202,7 +202,7 @@ function mapPrimitiveDepsToIDs(strandsContext, typeInfo, dependsOn) { let calculatedDimensions = 0; let originalNodeID = null; for (const dep of inputs.flat(Infinity)) { - if (dep instanceof StrandsNode) { + if (dep && dep.isStrandsNode) { const node = DAG.getNodeDataFromID(dag, dep.id); originalNodeID = dep.id; baseType = node.baseType; diff --git a/src/strands/strands_node.js b/src/strands/strands_node.js index bfa58d0c89..7d69b4438f 100644 --- a/src/strands/strands_node.js +++ b/src/strands/strands_node.js @@ -7,6 +7,7 @@ export class StrandsNode { this.id = id; this.strandsContext = strandsContext; this.dimension = dimension; + this.isStrandsNode = true; // Store original identifier for varying variables const dag = this.strandsContext.dag;