1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

Fix null dereference error when selected cell ID is undefined

This commit is contained in:
Andrew Kingston 2024-05-13 13:33:55 +01:00
parent 3351680eb6
commit 5db7b851d3

View file

@ -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 }
}