Skip to content

Commit

Permalink
just return early instead of throwing an error until we rewrite this …
Browse files Browse the repository at this point in the history
…middleware for the new siteTree structure
  • Loading branch information
sarahs committed Apr 9, 2021
1 parent 35922bc commit c026732
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions middleware/breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ module.exports = async function breadcrumbs (req, res, next) {
pathParts.shift()

const productPath = path.posix.join('/', req.context.currentProduct)

if (!req.context.siteTree[req.language][req.context.currentVersion].products) {
return next()
}

const product = req.context.siteTree[req.language][req.context.currentVersion].products[req.context.currentProduct]

if (!product) {
Expand Down

0 comments on commit c026732

Please sign in to comment.