mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +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) {
|
||||
seen.push(variable)
|
||||
if (promptValues[variable]) {
|
||||
if (promptValues[variable] != null) {
|
||||
seen.pop()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ export const getVariableValue = async (
|
||||
if (variableFullPath.startsWith('$vars.')) {
|
||||
const vars = await getGlobalVariable(appDataSource, flowData, availableVariables, variableOverrides)
|
||||
const variableValue = get(vars, variableFullPath.replace('$vars.', ''))
|
||||
if (variableValue) {
|
||||
if (variableValue != null) {
|
||||
variableDict[`{{${variableFullPath}}}`] = variableValue
|
||||
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
||||
}
|
||||
@@ -887,7 +887,7 @@ export const getVariableValue = async (
|
||||
|
||||
if (variableFullPath.startsWith('$flow.') && flowData) {
|
||||
const variableValue = get(flowData, variableFullPath.replace('$flow.', ''))
|
||||
if (variableValue) {
|
||||
if (variableValue != null) {
|
||||
variableDict[`{{${variableFullPath}}}`] = variableValue
|
||||
returnVal = returnVal.split(`{{${variableFullPath}}}`).join(variableValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user