Skip to content

Commit e17ca7c

Browse files
authored
fix: node migration TypeError (#4260)
1 parent 77d2cae commit e17ca7c

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/schemas/nodeDef/migration.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,26 @@ export function transformNodeDefV1ToV2(
4646
const outputs: OutputSpecV2[] = []
4747

4848
if (nodeDefV1.output) {
49-
nodeDefV1.output.forEach((outputType, index) => {
50-
const outputSpec: OutputSpecV2 = {
51-
index,
52-
name: nodeDefV1.output_name?.[index] || `output_${index}`,
53-
type: Array.isArray(outputType) ? 'COMBO' : outputType,
54-
is_list: nodeDefV1.output_is_list?.[index] || false,
55-
tooltip: nodeDefV1.output_tooltips?.[index]
56-
}
49+
if (Array.isArray(nodeDefV1.output)) {
50+
nodeDefV1.output.forEach((outputType, index) => {
51+
const outputSpec: OutputSpecV2 = {
52+
index,
53+
name: nodeDefV1.output_name?.[index] || `output_${index}`,
54+
type: Array.isArray(outputType) ? 'COMBO' : outputType,
55+
is_list: nodeDefV1.output_is_list?.[index] || false,
56+
tooltip: nodeDefV1.output_tooltips?.[index]
57+
}
5758

58-
// Add options for combo outputs
59-
if (Array.isArray(outputType)) {
60-
outputSpec.options = outputType
61-
}
59+
// Add options for combo outputs
60+
if (Array.isArray(outputType)) {
61+
outputSpec.options = outputType
62+
}
6263

63-
outputs.push(outputSpec)
64-
})
64+
outputs.push(outputSpec)
65+
})
66+
} else {
67+
console.warn('nodeDefV1.output is not an array:', nodeDefV1.output)
68+
}
6569
}
6670

6771
// Create the V2 node definition

0 commit comments

Comments
 (0)