From 762b4224888cc5949eced048729fe313ec055f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Fri, 12 Aug 2022 15:29:25 +0200 Subject: [PATCH] fix(editor): Handling errors when opening settings and executions (#3877) --- .../src/components/ExecutionsList.vue | 18 +++++----- packages/editor-ui/src/views/NodeView.vue | 36 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/packages/editor-ui/src/components/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsList.vue index 915555ca7..d054307a3 100644 --- a/packages/editor-ui/src/components/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsList.vue @@ -100,14 +100,16 @@ - + + + {{ $locale.baseText('executionsList.retryWithCurrentlySavedWorkflow') }} diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 64d61944e..c2af37c64 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -2232,27 +2232,31 @@ export default mixins( __removeConnectionByConnectionInfo (info: OnConnectionBindInfo, removeVisualConnection = false) { // @ts-ignore const sourceInfo = info.sourceEndpoint.getParameters(); + const sourceNode = this.$store.getters.getNodeById(sourceInfo.nodeId); // @ts-ignore const targetInfo = info.targetEndpoint.getParameters(); + const targetNode = this.$store.getters.getNodeById(targetInfo.nodeId); - const connectionInfo = [ - { - node: this.$store.getters.getNodeById(sourceInfo.nodeId).name, - type: sourceInfo.type, - index: sourceInfo.index, - }, - { - node: this.$store.getters.getNodeById(targetInfo.nodeId).name, - type: targetInfo.type, - index: targetInfo.index, - }, - ] as [IConnection, IConnection]; + if (sourceNode && targetNode) { + const connectionInfo = [ + { + node: sourceNode.name, + type: sourceInfo.type, + index: sourceInfo.index, + }, + { + node: targetNode.name, + type: targetInfo.type, + index: targetInfo.index, + }, + ] as [IConnection, IConnection]; - if (removeVisualConnection) { - this.__deleteJSPlumbConnection(info.connection); + if (removeVisualConnection) { + this.__deleteJSPlumbConnection(info.connection); + } + + this.$store.commit('removeConnection', { connection: connectionInfo }); } - - this.$store.commit('removeConnection', { connection: connectionInfo }); }, async duplicateNode (nodeName: string) { if (this.editAllowedCheck() === false) {