mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +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:
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user