Skip to content

Commit

Permalink
[4422] Prevent application crash when an edge path is malformed durin…
Browse files Browse the repository at this point in the history
…g node moves

Bug: #4422
Signed-off-by: Florian ROUËNÉ <[email protected]>
  • Loading branch information
frouene authored and sbegaudeau committed Jan 17, 2025
1 parent 7284563 commit 28cb147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ See https://github.com/mui/material-ui/issues/15618[this link] for additional de
- https://github.com/eclipse-sirius/sirius-web/issues/4416[#4416] [sirius-web] Fix the way migration participant were executed.
Before this contribution, migration participants were executed if the project being opened was a studio.
Now they are executed for some data if the data was coming from a studio too.
- https://github.com/eclipse-sirius/sirius-web/issues/4422[#4422] [diagram] Prevent application crash when an edge path is malformed during node moves


=== New Features
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* Copyright (c) 2024, 2025 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -114,9 +114,10 @@ export const SmoothStepEdgeWrapper = memo((props: EdgeProps<Edge<MultiLabelEdgeD
targetPosition,
});

const quadraticCurvePoints: { x: number; y: number }[] = parse(smoothEdgePath).filter(
(segment) => segment.code === 'Q'
);
const quadraticCurvePoints: {
x: number;
y: number;
}[] = smoothEdgePath.includes('NaN') ? [] : parse(smoothEdgePath).filter((segment) => segment.code === 'Q');

if (quadraticCurvePoints.length > 0) {
const firstPoint = quadraticCurvePoints[0];
Expand Down

0 comments on commit 28cb147

Please sign in to comment.