From 65165701b9497637b65c1bdd0ae3b575d01a960b Mon Sep 17 00:00:00 2001 From: Seung Park Date: Fri, 6 Jan 2023 10:52:40 -0500 Subject: [PATCH] DOP-3436 front end (#748) check for children existence for toc node --- src/components/Sidenav/TOCNode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sidenav/TOCNode.js b/src/components/Sidenav/TOCNode.js index 0cf566f5d..fd07f7210 100644 --- a/src/components/Sidenav/TOCNode.js +++ b/src/components/Sidenav/TOCNode.js @@ -54,7 +54,7 @@ const Wrapper = ({ children, hasVersions }) => { const TOCNode = ({ activeSection, handleClick, level = BASE_NODE_LEVEL, node }) => { const { title, slug, url, children, options = {} } = node; const target = slug || url; - const hasChildren = !!children.length; + const hasChildren = !!children?.length; const hasVersions = !!(options?.versions?.length > 1); // in the event there is only one version, do we show version selector? const isActive = isActiveTocNode(activeSection, slug, children); const isSelected = isSelectedTocNode(activeSection, slug);