fix(search): Don't crash the page if a starts a search with the letter "H" (#1351)

Laine Hallot committed Nov 5, 2024 at 11:17 UTC 293ef85d0a95ffb664a1799182192305d7874ec7
1 file changed +1 -1
src/components/search.js
+1 -1
@@ -31,7 +31,7 @@ const SearchResults = ({results, getItemProps, highlightedIndex}) => {
31 // don't all appear the same in the search results
32 const variant = getNav.getVariant(getNav.getVariantRoot(item.path), item.path)
33 const hierarchy = getNav.getItemBreadcrumbs(item.path)
34 - if (!variant || variant !== hierarchy[hierarchy.length - 1].shortName) {
34 + if (!variant || variant !== hierarchy[hierarchy.length - 1]?.shortName) {
35 hierarchy.pop()
36 }
37