Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(tree-select): avoid incorrect node selection when value is empty (#16898)

chanxe5bc644c1852
diff --git a/web/src/components/tree-select.tsx b/web/src/components/tree-select.tsx
index 1e537bfc79..ed228499fc 100644
--- a/web/src/components/tree-select.tsx
+++ b/web/src/components/tree-select.tsx
@@ -67,7 +67,7 @@ export function TreeSelect({
const selectedNode = useMemo(() => {
const find = (nodes: TreeSelectNode[]): TreeSelectNode | undefined => {
for (const node of nodes) {
- if (node.id === value) return node;
+ if (node.id === value && value) return node;
if (node.children) {
const found = find(node.children);
if (found) return found;