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(core/tools): Fix the issue with iterating over None in `_transform_tool_parameters_type`. (#5190)

-LAN-ed53ef29f4bb
diff --git a/api/core/tools/tool/tool.py b/api/core/tools/tool/tool.py
index 37432a6116d..b48daf0c52b 100644
--- a/api/core/tools/tool/tool.py
+++ b/api/core/tools/tool/tool.py
@@ -237,10 +237,10 @@ class Tool(BaseModel, ABC):
"""
# Temp fix for the issue that the tool parameters will be converted to empty while validating the credentials
result = deepcopy(tool_parameters)
- for parameter in self.parameters:
+ for parameter in self.parameters or []:
if parameter.name in tool_parameters:
result[parameter.name] = ToolParameterConverter.cast_parameter_by_type(tool_parameters[parameter.name], parameter.type)
-
+
return result
@abstractmethod