Skip to content

Commit c95b33b

Browse files
committed
fix: add null check
1 parent f02a7d7 commit c95b33b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cypress/integration/static-root/i18n.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ describe('Localization', () => {
2222
'Accept-Language': 'fr;q=0.9',
2323
},
2424
})
25-
cy.findByText('The current locale is fr')
2625
cy.url().should('eq', `${Cypress.config().baseUrl}/fr/`)
26+
cy.findByText('The current locale is fr')
2727
})
2828

2929
it('should use the NEXT_LOCALE cookie over Accept-Language header to determine the default locale', () => {

src/helpers/redirects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const generateRedirects = async ({
6363
})),
6464
)
6565

66-
if (i18n.localeDetection !== false) {
66+
if (i18n && i18n.localeDetection !== false) {
6767
netlifyConfig.redirects.push(...generateLocaleRedirects({ i18n, basePath, trailingSlash }))
6868
}
6969

0 commit comments

Comments
 (0)