Skip to content

Commit c380715

Browse files
authored
Merge pull request #26946 from github/repo-sync
Repo sync
2 parents 15a846a + 5e7f74f commit c380715

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

middleware/contextualizers/glossaries.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ import { correctTranslatedContentStrings } from '../../lib/correct-translation-c
66
export default async function glossaries(req, res, next) {
77
if (!req.pagePath.endsWith('get-started/quickstart/github-glossary')) return next()
88

9+
// If the current version (which is found as part of the URL), does not
10+
// correspond to a supported version, the Liquid rendering will fail
11+
// (if there's uses of `ifversion` in any the Liquid).
12+
// So we'll skip this contextualizer and let the 404 error take over later.
13+
if (!req.context.currentVersionObj) return next()
14+
915
// When the current language is *not* English, we'll need to get the English
1016
// glossary based on the term. We'll use this to render the translated
1117
// glossaries. For example, if the Korean translation has a corruption

0 commit comments

Comments
 (0)