From f1ae37c84ba0057c6be6439aeece59d142b9d6d2 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Mon, 22 Aug 2022 07:09:27 +0200 Subject: [PATCH] fix: Crash when adding a new point in the line editor #5602 (#5606) Update linearElementEditor.ts --- src/element/linearElementEditor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/element/linearElementEditor.ts b/src/element/linearElementEditor.ts index 0b9ab6d5..48972a82 100644 --- a/src/element/linearElementEditor.ts +++ b/src/element/linearElementEditor.ts @@ -686,7 +686,9 @@ export class LinearElementEditor { const point = element.points[index]; const { x, y } = element; - return rotate(x + point[0], y + point[1], cx, cy, element.angle); + return point + ? rotate(x + point[0], y + point[1], cx, cy, element.angle) + : rotate(x, y, cx, cy, element.angle); } static pointFromAbsoluteCoords(