fix: erroring table of contents (#27826)

Table of Contents errored in some cases because I forgot to check for
the case where the value can be null.
This commit is contained in:
Charis authored and GitHub committed 2024-07-05 16:42:52 +00:00
1 parent 0c34787f9e
commit 2f6328ea3c
1 file changed
+1 -1
@@ -99,7 +99,7 @@ const GuidesTableOfContents = ({
return { text, link, level } as Partial<TOCHeader>
})
.filter((x): x is TOCHeader => !!x.text && !!x.link && !!x.level)
.filter((x): x is TOCHeader => !!x && !!x.text && !!x.link && !!x.level)
setTocList(newHeadings)
})