diff --git a/src/components/ColumnsModal/ColumnsModalComponent.jsx b/src/components/ColumnsModal/ColumnsModalComponent.jsx index eddc2ccd..51aa156b 100644 --- a/src/components/ColumnsModal/ColumnsModalComponent.jsx +++ b/src/components/ColumnsModal/ColumnsModalComponent.jsx @@ -62,8 +62,8 @@ import DraggableColumnsModalItem from './subcomponents/DraggableColumnsModalItem const TableColumnsModalComponent = () => { const displayColumnsModal = useSelector((state) => state.settings.displayColumnsModal); - const alertCustomDetailFields = useSelector((state) => state.settings.alertCustomDetailFields); - const computedFields = useSelector((state) => state.settings.computedFields); + const alertCustomDetailFields = useSelector((state) => state.settings.alertCustomDetailFields) || []; + const computedFields = useSelector((state) => state.settings.computedFields) || []; const incidentTableColumns = useSelector((state) => state.incidentTable.incidentTableColumns); const { incidentTableState, diff --git a/src/config/column-generator.jsx b/src/config/column-generator.jsx index 3d334328..76e76328 100644 --- a/src/config/column-generator.jsx +++ b/src/config/column-generator.jsx @@ -908,6 +908,9 @@ export const customAlertColumns = (savedColumns) => { export const customComputedColumns = (savedColumns) => { const allColumns = defaultColumns(); + if (!savedColumns) { + return []; + } return savedColumns.map((column) => { if ( column.columnType === 'computed' @@ -921,6 +924,9 @@ export const customComputedColumns = (savedColumns) => { export const columnsForSavedColumns = (savedColumns) => { const allColumns = defaultColumns(); + if (!savedColumns) { + return []; + } const columns = savedColumns .map((column) => { const foundColumn = allColumns.find((c) => c.originalHeader === column.Header);