Fixed the null reference issue for auto-rotating

This commit is contained in:
Gürkan Güran 2022-11-29 17:18:14 +01:00
parent eb1fdea49d
commit 948a0bae07

View file

@ -56,11 +56,11 @@ function hasPortAnEdge(graph: Graph, port: PortManager.PortMetadata) {
}
function findMatchingPortForEdge(node: Node<Node.Properties>, 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(