From fc44bf5c71754f70d15687d51ad9ecb968952e44 Mon Sep 17 00:00:00 2001 From: matejaivosevic Date: Sun, 21 Jul 2024 14:50:23 +0200 Subject: [PATCH] fix: set initial matrix lenght 0 if there is no initial matrix --- .../src/domain/entities/canvas-matrix/CanvasMatrix.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ketcher-core/src/domain/entities/canvas-matrix/CanvasMatrix.ts b/packages/ketcher-core/src/domain/entities/canvas-matrix/CanvasMatrix.ts index 3c92fbdd38..9727667f3a 100644 --- a/packages/ketcher-core/src/domain/entities/canvas-matrix/CanvasMatrix.ts +++ b/packages/ketcher-core/src/domain/entities/canvas-matrix/CanvasMatrix.ts @@ -201,7 +201,7 @@ export class CanvasMatrix { } const initialMatrixRowLength = - this.matrixConfig.initialMatrix.getRow(rowNumber).length; + this.matrixConfig.initialMatrix?.getRow(rowNumber)?.length || 0; if (columnNumber >= initialMatrixRowLength) { let emptyCellsAmount = this.initialMatrixWidth - columnNumber;