Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: TypeError: a.variable_selector.join is not a function (#17950)

crazywoola4aecc9f09002
diff --git a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx
index e7392eece61..170e6484c49 100644
--- a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx
+++ b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx
@@ -97,20 +97,13 @@ const VarList: FC<Props> = ({
const handleFilterToAssignedVar = useCallback((index: number) => {
return (payload: Var) => {
- const item = list[index]
- const assignedVarType = item.variable_selector ? getAssignedVarType?.(item.variable_selector) : undefined
+ const { variable_selector, operation } = list[index]
+ if (!variable_selector || !operation || !filterToAssignedVar) return true
- if (item.variable_selector.join('.') === `${payload.nodeId}.${payload.variable}`)
- return false
+ const assignedVarType = getAssignedVarType?.(variable_selector)
+ const isSameVariable = Array.isArray(variable_selector) && variable_selector.join('.') === `${payload.nodeId}.${payload.variable}`
- if (!filterToAssignedVar || !item.variable_selector || !assignedVarType || !item.operation)
- return true
-
- return filterToAssignedVar(
- payload,
- assignedVarType,
- item.operation,
- )
+ return !isSameVariable && (!assignedVarType || filterToAssignedVar(payload, assignedVarType, operation))
}
}, [list, filterToAssignedVar, getAssignedVarType])