fix: Fix context undefined

This commit is contained in:
Atinux 2017-10-31 18:32:42 +01:00
parent e15c92f1c8
commit 76aca28cdc

View File

@ -203,8 +203,8 @@ async function render (to, from, next) {
if (app.context._redirected) return
// Load layout for error page
const layout = await this.loadLayout(typeof NuxtError.layout === 'function' ? NuxtError.layout(app.context) : NuxtError.layout)
await callMiddleware.call(this, Components, context, layout)
if (context._redirected) return
await callMiddleware.call(this, Components, app.context, layout)
if (app.context._redirected) return
// Show error page
app.context.error({ statusCode: 404, message: '<%= messages.error_404 %>' })
return next()