Quick updates for #8989 - this issue appeared to be fixed already but just adding a few extra bits of security to make sure that looping only occurs when valid data is found in the binding.
This commit is contained in:
parent
e260204186
commit
27b472b662
1 changed files with 9 additions and 5 deletions
|
@ -37,9 +37,13 @@ function getLoopIterations(loopStep: LoopStep, input: LoopInput) {
|
||||||
if (!loopStep || !binding) {
|
if (!loopStep || !binding) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
return Array.isArray(binding)
|
if (Array.isArray(binding)) {
|
||||||
? binding.length
|
return binding.length
|
||||||
: automationUtils.stringSplit(binding).length
|
}
|
||||||
|
if (typeof binding === "string") {
|
||||||
|
return automationUtils.stringSplit(binding).length
|
||||||
|
}
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -280,13 +284,13 @@ class Orchestrator {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
let item
|
let item = []
|
||||||
if (
|
if (
|
||||||
typeof loopStep.inputs.binding === "string" &&
|
typeof loopStep.inputs.binding === "string" &&
|
||||||
loopStep.inputs.option === "String"
|
loopStep.inputs.option === "String"
|
||||||
) {
|
) {
|
||||||
item = automationUtils.stringSplit(newInput.binding)
|
item = automationUtils.stringSplit(newInput.binding)
|
||||||
} else {
|
} else if (Array.isArray(loopStep.inputs.binding)) {
|
||||||
item = loopStep.inputs.binding
|
item = loopStep.inputs.binding
|
||||||
}
|
}
|
||||||
this._context.steps[loopStepNumber] = {
|
this._context.steps[loopStepNumber] = {
|
||||||
|
|
Loading…
Reference in a new issue