Skip to content

Commit

Permalink
Merge pull request #1384 from Oneirocom/default-input-bug
Browse files Browse the repository at this point in the history
Fix bug with default input
  • Loading branch information
parzival418 authored Nov 4, 2023
2 parents bb85e89 + 0046a5a commit eb70359
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/core/shared/src/nodes/io/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ export class InputComponent extends MagickComponent<InputReturn> {
name: 'Input Name',
icon: 'moon',
defaultValue: 'Default',
onData: data => {
node.data.name = `Input - ${data}`
},
tooltip: 'Tooltip text for Input Name',
}

Expand Down Expand Up @@ -261,13 +258,15 @@ export class InputComponent extends MagickComponent<InputReturn> {
if (node?._task) node._task.closed = []

let output = data[node.data.name]
if (output === undefined && node.data.name === "Input - Default") {
if (output === undefined && node.data.name === 'Input - Default') {
output = Object.values(data)[0]
}

if (!output) {
this.logger.error('No input recieved in input node for ' + node.data.name)
throw new Error("No input recieved")
this.logger.error(
'No input recieved in input node for ' + node.data.name
)
throw new Error('No input recieved')
}

return {
Expand Down

0 comments on commit eb70359

Please sign in to comment.