mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-18 15:35:56 +08:00
fix(document_extractor): handle empty variable values properly
- Added check for variable.value existence before type validation. - Prevents erroneous type checks on empty variables, improving robustness.
This commit is contained in:
parent
3ff88f4f3c
commit
94b946c715
@ -41,7 +41,7 @@ class DocumentExtractorNode(BaseNode):
|
||||
if variable is None:
|
||||
error_message = f"File variable not found for selector: {variable_selector}"
|
||||
return NodeRunResult(status=WorkflowNodeExecutionStatus.FAILED, error=error_message)
|
||||
if not isinstance(variable, ArrayFileSegment | FileSegment):
|
||||
if variable.value and not isinstance(variable, ArrayFileSegment | FileSegment):
|
||||
error_message = f"Variable {variable_selector} is not an ArrayFileSegment"
|
||||
return NodeRunResult(status=WorkflowNodeExecutionStatus.FAILED, error=error_message)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user