Skip to content

Commit

Permalink
fix(search): Don't crash the page if a starts a search with the lette…
Browse files Browse the repository at this point in the history
…r "H" (#1351)
  • Loading branch information
laine-hallot authored Nov 5, 2024
1 parent aa40555 commit 293ef85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SearchResults = ({results, getItemProps, highlightedIndex}) => {
// don't all appear the same in the search results
const variant = getNav.getVariant(getNav.getVariantRoot(item.path), item.path)
const hierarchy = getNav.getItemBreadcrumbs(item.path)
if (!variant || variant !== hierarchy[hierarchy.length - 1].shortName) {
if (!variant || variant !== hierarchy[hierarchy.length - 1]?.shortName) {
hierarchy.pop()
}

Expand Down

0 comments on commit 293ef85

Please sign in to comment.