diff --git a/packages/editor-ui/src/views/NodeView.v2.vue b/packages/editor-ui/src/views/NodeView.v2.vue index 56ad8f5a43..4f58b52294 100644 --- a/packages/editor-ui/src/views/NodeView.v2.vue +++ b/packages/editor-ui/src/views/NodeView.v2.vue @@ -911,7 +911,10 @@ async function onAddNodesAndConnections( await addConnections(mappedConnections); uiStore.resetLastInteractedWith(); - selectNodes([addedNodes[addedNodes.length - 1].id]); + + if (addedNodes.length > 0) { + selectNodes([addedNodes[addedNodes.length - 1].id]); + } } async function onRevertAddNode({ node }: { node: INodeUi }) {