Merge pull request #13672 from Budibase/fix/grid-null-dereference-error
Fix null dereference error when selected cell ID is undefined
This commit is contained in:
commit
307583b3db
|
@ -5,11 +5,11 @@ import { TypeIconMap } from "../../../constants"
|
||||||
// using something very unusual to avoid this problem
|
// using something very unusual to avoid this problem
|
||||||
const JOINING_CHARACTER = "‽‽"
|
const JOINING_CHARACTER = "‽‽"
|
||||||
|
|
||||||
export const parseCellID = rowId => {
|
export const parseCellID = cellId => {
|
||||||
if (!rowId) {
|
if (!cellId) {
|
||||||
return undefined
|
return { id: undefined, field: undefined }
|
||||||
}
|
}
|
||||||
const parts = rowId.split(JOINING_CHARACTER)
|
const parts = cellId.split(JOINING_CHARACTER)
|
||||||
const field = parts.pop()
|
const field = parts.pop()
|
||||||
return { id: parts.join(JOINING_CHARACTER), field }
|
return { id: parts.join(JOINING_CHARACTER), field }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue