From f288f79c6c8ef19d174f44d42d88fcadf2bff7d3 Mon Sep 17 00:00:00 2001 From: naumov Date: Wed, 4 Oct 2023 16:28:43 +0200 Subject: [PATCH] CB-4065 safe context getter --- .../src/DataGrid/TableColumnHeader/useTableColumnDnD.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/useTableColumnDnD.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/useTableColumnDnD.ts index 433ab12018..2fe1767c8b 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/useTableColumnDnD.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/TableColumnHeader/useTableColumnDnD.ts @@ -60,7 +60,7 @@ export function useTableColumnDnD(model: IDatabaseDataModel, resultIndex: number let side: TableColumnInsertPositionSide = null; if (columnKey && dndBox.state.isOver && dndBox.state.context) { - const dndColumnKey = dndBox.state.context.get(DATA_CONTEXT_DV_DDM_RS_COLUMN_KEY); + const dndColumnKey = dndBox.state.context.tryGet(DATA_CONTEXT_DV_DDM_RS_COLUMN_KEY); if (resultSetViewAction && dndColumnKey && resultSetViewAction.columnIndex(columnKey) > resultSetViewAction.columnIndex(dndColumnKey)) { side = 'right';