From 948a0bae076e8ea60305124dc457eb98f2589919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20G=C3=BCran?= Date: Tue, 29 Nov 2022 17:18:14 +0100 Subject: [PATCH] Fixed the null reference issue for auto-rotating --- src/designer/elsa-workflows-designer/src/utils/graph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/designer/elsa-workflows-designer/src/utils/graph.ts b/src/designer/elsa-workflows-designer/src/utils/graph.ts index faff7a9b9..0eb008c17 100644 --- a/src/designer/elsa-workflows-designer/src/utils/graph.ts +++ b/src/designer/elsa-workflows-designer/src/utils/graph.ts @@ -56,11 +56,11 @@ function hasPortAnEdge(graph: Graph, port: PortManager.PortMetadata) { } function findMatchingPortForEdge(node: Node, position: string, portType: string, portName: string) { - return node.getPorts().find(p => p.position == position && p.type == portType && p.attrs?.text?.text == portName); + return node.getPorts().find(p => p.position == position && p.type == portType && (portName == "In" || p.attrs?.text?.text == portName)); } function getPortNameByPortId(portId: string) { - return portId.split('_')[1] == 'null' ? null : portId.split('_')[1] == 'In' ? null : portId.split('_')[1]; + return portId.split('_')[1] == 'null' ? null : portId.split('_')[1]; } function updatePortsAndEdges(