diff --git a/src/data-workspace/section-form/section-form.js b/src/data-workspace/section-form/section-form.js index 4250a3f14f..4853914470 100644 --- a/src/data-workspace/section-form/section-form.js +++ b/src/data-workspace/section-form/section-form.js @@ -6,6 +6,18 @@ import { useSectionFilter } from '../../shared/index.js' import { SectionFormSection } from './section.js' import styles from './section.module.css' +const parseDisplayOptions = (displayOptionString) => { + try { + return ( + displayOptionString && + JSON.parse(this.props.model['displayOptions']) + ) + } catch (e) { + console.error(e) + return undefined + } +} + export const SectionForm = ({ dataSet, globalFilterText }) => { const [sectionId] = useSectionFilter() const filteredSections = sectionId @@ -13,8 +25,7 @@ export const SectionForm = ({ dataSet, globalFilterText }) => { : dataSet.sections const { displayOptions: displayOptionString } = dataSet - const displayOptions = - displayOptionString && JSON.parse(displayOptionString) + const displayOptions = parseDisplayOptions(displayOptionString) if (dataSet.renderAsTabs) { return (