Skip to content

Commit 406c666

Browse files
author
Ole Martin Handeland
committed
Fixing missing node error that appeared after a while
1 parent 19ac228 commit 406c666

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/layout/RepeatingGroup/Summary2/RepeatingGroupTableSummary/RepeatingGroupTableSummary.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,18 @@ type DataCellProps = {
202202
function DataCell({ nodeId, columnSettings }: DataCellProps) {
203203
const node = useNode(nodeId);
204204
if (!node) {
205-
throw new Error(`Could not find node with id ${nodeId}`);
205+
return null;
206206
}
207+
208+
return (
209+
<NodeDataCell
210+
node={node}
211+
columnSettings={columnSettings}
212+
/>
213+
);
214+
}
215+
216+
function NodeDataCell({ node, columnSettings }: { node: LayoutNode } & Pick<DataCellProps, 'columnSettings'>) {
207217
const { langAsString } = useLanguage();
208218
const headerTitle = langAsString(useTableTitle(node));
209219
const style = useColumnStylesRepeatingGroups(node, columnSettings);

0 commit comments

Comments
 (0)