From 5db7b851d3347ae8b8e323a7d0d7aacd85d41340 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 13 May 2024 13:33:55 +0100 Subject: [PATCH] Fix null dereference error when selected cell ID is undefined --- packages/frontend-core/src/components/grid/lib/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend-core/src/components/grid/lib/utils.js b/packages/frontend-core/src/components/grid/lib/utils.js index b105d12714..5dd56dbbd9 100644 --- a/packages/frontend-core/src/components/grid/lib/utils.js +++ b/packages/frontend-core/src/components/grid/lib/utils.js @@ -5,11 +5,11 @@ import { TypeIconMap } from "../../../constants" // using something very unusual to avoid this problem const JOINING_CHARACTER = "‽‽" -export const parseCellID = rowId => { - if (!rowId) { - return undefined +export const parseCellID = cellId => { + if (!cellId) { + return { id: undefined, field: undefined } } - const parts = rowId.split(JOINING_CHARACTER) + const parts = cellId.split(JOINING_CHARACTER) const field = parts.pop() return { id: parts.join(JOINING_CHARACTER), field } }