Skip to content

Commit 18c2454

Browse files
committed
patch: optional array
1 parent 2c938ac commit 18c2454

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/TableOfContents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ const TableOfContents: React.FC<IProps> = ({
408408
const activeHash = useActiveHash(titleIds)
409409

410410
// Exclude <h1> from TOC
411-
if (items.length === 1) {
411+
if (items?.length === 1) {
412412
items = items[0].items!
413413
}
414414
if (!items) {

0 commit comments

Comments
 (0)