mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fix null pointer exception in with-react-18next (#3944)
The example does not crash if a user chooses a non-existing language (e.g. goes to localhost:3000/?lng=ru)
This commit is contained in:
parent
0107051eaa
commit
a225da4bb1
|
@ -45,7 +45,7 @@ i18n.getInitialProps = (req, namespaces) => {
|
|||
req.i18n.languages.forEach((l) => {
|
||||
initialI18nStore[l] = {}
|
||||
namespaces.forEach((ns) => {
|
||||
initialI18nStore[l][ns] = req.i18n.services.resourceStore.data[l][ns] || {}
|
||||
initialI18nStore[l][ns] = (req.i18n.services.resourceStore.data[l] || {})[ns] || {}
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue