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: dataset_tool npe (#274)

John Wang44a1aa5e4458
diff --git a/api/core/chain/multi_dataset_router_chain.py b/api/core/chain/multi_dataset_router_chain.py
index b11e3271ab7..a66b5fdb117 100644
--- a/api/core/chain/multi_dataset_router_chain.py
+++ b/api/core/chain/multi_dataset_router_chain.py
@@ -110,7 +110,10 @@ class MultiDatasetRouterChain(Chain):
response_mode='no_synthesizer', # "compact"
callback_handler=DatasetToolCallbackHandler(conversation_message_task)
)
- dataset_tools[dataset.id] = dataset_tool
+
+ if dataset_tool:
+ dataset_tools[dataset.id] = dataset_tool
+
return cls(
router_chain=router_chain,
dataset_tools=dataset_tools,