Skip to content

Commit 1a25258

Browse files
authored
Merge pull request #121 from code0-tech/feat/flow-setting-undefiend-check
Adding nillable check also for settings
2 parents e4ceaa3 + a46cd77 commit 1a25258

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export function generateFlowSourceCode(
187187
if (p?.value?.__typename === "SubFlowValue" && (p.value.startingNodeId || p.value.functionDefinition?.id)) subTreeIds.add(p.value.startingNodeId || p.value.functionDefinition?.id);
188188
}));
189189

190-
const flowCode = flow ? `const flow_${sanitizeId(flow.id ?? "")} = /* @pos null null */ flow(${flow.settings?.nodes?.map((setting, index) => `/* @pos null ${index} */ ${stringify(setting?.value)}`).join(", ") ?? ""});` : ""
190+
const flowCode = flow ? `const flow_${sanitizeId(flow.id ?? "")} = /* @pos null null */ flow(${flow.settings?.nodes?.map((setting, index) => `/* @pos null ${index} */ ${setting?.value !== null && setting?.value !== undefined ? stringify(setting?.value) : undefined}`).join(", ") ?? ""});` : ""
191191

192192
const executionCode = nodes
193193
.filter(n => n?.id && !nextNodeIds.has(n.id) && !subTreeIds.has(n.id))

0 commit comments

Comments
 (0)