mirror of
https://github.com/langgenius/dify.git
synced 2026-03-29 09:59:59 +08:00
fix(use-initial): handle potential undefined nodeData by providing a fallback object
This commit is contained in:
@ -31,7 +31,7 @@ export const useInitial = (id: string) => {
|
||||
|
||||
const handleInitial = useCallback(() => {
|
||||
const nodeData = getNodeData()
|
||||
const { provider_id, tool_name, _notInitialized } = nodeData?.data
|
||||
const { provider_id, tool_name, _notInitialized } = nodeData?.data || {}
|
||||
const currCollection = buildInTools.find(item => canFindTool(item.id, provider_id))
|
||||
const currTool = currCollection?.tools.find(tool => tool.name === tool_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user