Skip to content

Commit 4944df0

Browse files
committed
fix: reported issue fixed - unsafe startNode - endNode comparision
1 parent a65706e commit 4944df0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/app/view/editor-main-view/data-views/nodes.view.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,19 +729,19 @@ export class NodesView {
729729
this.editorView.trainrunSectionPreviewLineView.getExistingTrainrunSection();
730730
}
731731
this.editorView.trainrunSectionPreviewLineView.stopPreviewLine();
732-
if (startNode === endNode) {
732+
if (!startNode || !endNode || startNode?.getId() === endNode?.getId()) {
733733
return;
734734
}
735735
if (existingTrainrunSection !== null) {
736736
if (
737-
existingTrainrunSection.getSourceNode() === startNode &&
738-
existingTrainrunSection.getTargetNode() === endNode
737+
existingTrainrunSection.getSourceNodeId() === startNode.getId() &&
738+
existingTrainrunSection.getTargetNodeId() === endNode.getId()
739739
) {
740740
return;
741741
}
742742
if (
743-
existingTrainrunSection.getSourceNode() === endNode &&
744-
existingTrainrunSection.getTargetNode() === startNode
743+
existingTrainrunSection.getSourceNodeId() === endNode.getId() &&
744+
existingTrainrunSection.getTargetNodeId() === startNode.getId()
745745
) {
746746
return;
747747
}

0 commit comments

Comments
 (0)