mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Bugfix/Handling empty strings when resolving variables (#3864)
Bugfix for how to handle empty strings when resolving variables
This commit is contained in:
@@ -249,7 +249,7 @@ const runPrediction = async (
|
|||||||
|
|
||||||
for (const variable of inputVariables) {
|
for (const variable of inputVariables) {
|
||||||
seen.push(variable)
|
seen.push(variable)
|
||||||
if (promptValues[variable]) {
|
if (promptValues[variable] != null) {
|
||||||
seen.pop()
|
seen.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -879,7 +879,7 @@ export const getVariableValue = async (
|
|||||||
if (variableFullPath.startsWith('$vars.')) {
|
if (variableFullPath.startsWith('$vars.')) {
|
||||||
const vars = await getGlobalVariable(appDataSource, flowData, availableVariables, variableOverrides)
|
const vars = await getGlobalVariable(appDataSource, flowData, availableVariables, variableOverrides)
|
||||||
const variableValue = get(vars, variableFullPath.replace('$vars.', ''))
|
const variableValue = get(vars, variableFullPath.replace('$vars.', ''))
|
||||||
if (variableValue) {
|
if (variableValue != null) {
|
||||||
variableDict[`{{${variableFullPath}}}`] = variableValue
|
variableDict[`{{${variableFullPath}}}`] = variableValue
|
||||||
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
||||||
}
|
}
|
||||||
@@ -887,7 +887,7 @@ export const getVariableValue = async (
|
|||||||
|
|
||||||
if (variableFullPath.startsWith('$flow.') && flowData) {
|
if (variableFullPath.startsWith('$flow.') && flowData) {
|
||||||
const variableValue = get(flowData, variableFullPath.replace('$flow.', ''))
|
const variableValue = get(flowData, variableFullPath.replace('$flow.', ''))
|
||||||
if (variableValue) {
|
if (variableValue != null) {
|
||||||
variableDict[`{{${variableFullPath}}}`] = variableValue
|
variableDict[`{{${variableFullPath}}}`] = variableValue
|
||||||
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user