Skip to content

Commit

Permalink
fix(lazy): null-check nuxtState as it might not exist in SPA (#859)
Browse files Browse the repository at this point in the history
At least in older Nuxt versions.

Resolves #858
  • Loading branch information
rchl authored Aug 21, 2020
1 parent 475c349 commit 6763390
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/templates/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function loadLanguageAsync (context, locale) {
let messages
if (process.client) {
const { nuxtState } = context
if (nuxtState.__i18n && nuxtState.__i18n.langs[locale]) {
if (nuxtState && nuxtState.__i18n && nuxtState.__i18n.langs[locale]) {
messages = nuxtState.__i18n.langs[locale]
}
}
Expand Down

0 comments on commit 6763390

Please sign in to comment.