Browse Source

bug修复

Leo 2 years ago
parent
commit
2ab1517cea
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/module/datasource/component/DatasourceData.jsx

+ 3 - 1
src/module/datasource/component/DatasourceData.jsx

@@ -56,7 +56,9 @@ const DatasourceData = props => {
   }, [data])
 
   useEffect(() => {
-    onSelect(treeData[0]?.key)
+    if (treeData[0]) {
+      onSelect(treeData[0].key)
+    }
   }, [treeData])
 
   const onSelect = selectedKeys => {