1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Merge pull request #26086 from github/peterbe-1673-breadcrumbs-fail-on-some-enterprise-server-uris

breadcrumbs fail on some enterprise-server URIs
This commit is contained in:
Kevin Heis
2022-03-10 13:27:29 -08:00
committed by GitHub

View File

@@ -23,10 +23,14 @@ async function getBreadcrumbs(req) {
while (split.length > 2 && split[split.length - 1] !== currentVersion) {
const href = split.join('/')
const page = req.context.pages[href]
crumbs.push({
href,
title: await getShortTitle(page, req.context),
})
if (page) {
crumbs.push({
href,
title: await getShortTitle(page, req.context),
})
} else {
console.warn(`No page found with for '${href}'`)
}
split.pop()
}
crumbs.reverse()