1
0
Fork 0
mirror of synced 2024-08-15 18:11:40 +12:00

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:
mike12345567 2023-01-24 19:09:36 +00:00 committed by adrinr
parent e260204186
commit 27b472b662

View file

@ -37,9 +37,13 @@ function getLoopIterations(loopStep: LoopStep, input: LoopInput) {
if (!loopStep || !binding) {
return 1
}
return Array.isArray(binding)
? binding.length
: automationUtils.stringSplit(binding).length
if (Array.isArray(binding)) {
return binding.length
}
if (typeof binding === "string") {
return automationUtils.stringSplit(binding).length
}
return 1
}
/**
@ -280,13 +284,13 @@ class Orchestrator {
break
}
let item
let item = []
if (
typeof loopStep.inputs.binding === "string" &&
loopStep.inputs.option === "String"
) {
item = automationUtils.stringSplit(newInput.binding)
} else {
} else if (Array.isArray(loopStep.inputs.binding)) {
item = loopStep.inputs.binding
}
this._context.steps[loopStepNumber] = {