mirror of
https://github.com/langgenius/dify.git
synced 2026-04-22 11:47:40 +08:00
fix(1.0): unexpected error raise (#12812)
This commit is contained in:
@ -48,7 +48,9 @@ class PluginToolProviderController(BuiltinToolProviderController):
|
||||
"""
|
||||
return tool with given name
|
||||
"""
|
||||
tool_entity = next(tool_entity for tool_entity in self.entity.tools if tool_entity.identity.name == tool_name)
|
||||
tool_entity = next(
|
||||
(tool_entity for tool_entity in self.entity.tools if tool_entity.identity.name == tool_name), None
|
||||
)
|
||||
|
||||
if not tool_entity:
|
||||
raise ValueError(f"Tool with name {tool_name} not found")
|
||||
|
||||
Reference in New Issue
Block a user