From d2705c3aed14e9f5b23889fb0cd0ae424bfbd4a9 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 5 Sep 2024 19:05:40 -0500 Subject: [PATCH] Avoid null-pointer in TableUtils.getSectionsForRecordSidebar callback, if instance has no widgets --- src/qqq/components/forms/EntityForm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qqq/components/forms/EntityForm.tsx b/src/qqq/components/forms/EntityForm.tsx index 161d3a1..ea2032d 100644 --- a/src/qqq/components/forms/EntityForm.tsx +++ b/src/qqq/components/forms/EntityForm.tsx @@ -502,7 +502,7 @@ function EntityForm(props: Props): JSX.Element ///////////////////////////////////////////////// const tableSections = TableUtils.getSectionsForRecordSidebar(tableMetaData, [...tableMetaData.fields.keys()], (section: QTableSection) => { - const widget = metaData?.widgets.get(section.widgetName); + const widget = metaData?.widgets?.get(section.widgetName); if (widget) { if (widget.type == "childRecordList" && widget.defaultValues?.has("manageAssociationName")) @@ -1152,11 +1152,11 @@ function EntityForm(props: Props): JSX.Element { !props.isModal && - + } - +