From 811fe097ad01dd36b4061656ff12bd0881f2a049 Mon Sep 17 00:00:00 2001 From: Lawrence Liu Date: Wed, 20 Sep 2023 14:52:14 +0800 Subject: [PATCH] Fix error during process of 404 file without locale --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 31570b0..a3b54a6 100644 --- a/index.js +++ b/index.js @@ -74,7 +74,7 @@ module.exports = (options, context) => { let links = [] if (relatedLocales.length > 1) { - links = relatedLocales.map(localePrefix => { + links = relatedLocales.filter(localePrefix => localePrefix != null).map(localePrefix => { return { lang: locales[localePrefix].lang, url: withBase(normalizedPath.replace('/', localePrefix))