From 763d3d5fb85d12fa91b04743d8d7f8c6c8023672 Mon Sep 17 00:00:00 2001 From: Mohammad Smadi Date: Thu, 2 May 2024 22:33:46 +0300 Subject: [PATCH] fixed console error --- .../components/Node/NodeCreator/Modes/ActionsMode.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue index cc0801494d546..715b78707016d 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue @@ -145,11 +145,10 @@ function onSelected(actionCreateElement: INodeCreateElement) { ); if (isPlaceholderTriggerAction && isTriggerRootView.value) { - const actionNode = actions.value[0].key; - - emit('nodeTypeSelected', [actionData.key as string, actionNode]); + const actionNode = actions.value[0]?.key; + if (actionNode) emit('nodeTypeSelected', [actionData.key as string, actionNode]); } else if ( - actionData.key === OPEN_AI_NODE_TYPE && + actionData?.key === OPEN_AI_NODE_TYPE && (actionData?.value as IDataObject)?.resource === 'assistant' && (actionData?.value as IDataObject)?.operation === 'message' ) { @@ -199,7 +198,8 @@ function addHttpNode() { emit('nodeTypeSelected', [HTTP_REQUEST_NODE_TYPE]); if (telemetry) setAddedNodeActionParameters(updateData); - const app_identifier = actions.value[0].key; + const app_identifier = actions.value[0]?.key; + if (!app_identifier) return; void useExternalHooks().run('nodeCreateList.onActionsCustmAPIClicked', { app_identifier, });