From ab72355669243c128c9eadc41503a8d6520b928c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ch=C5=82odnicki?= Date: Tue, 4 Jun 2019 21:48:56 +0200 Subject: [PATCH] fix(vue-app): fix exception on property access of undefined object (#5867) --- packages/vue-app/template/components/nuxt.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/vue-app/template/components/nuxt.js b/packages/vue-app/template/components/nuxt.js index bcb39758e7..b9564dfd6f 100644 --- a/packages/vue-app/template/components/nuxt.js +++ b/packages/vue-app/template/components/nuxt.js @@ -42,7 +42,12 @@ export default { } const [matchedRoute] = this.$route.matched - const Component = matchedRoute && matchedRoute.components.default + + if (!matchedRoute) { + return this.$route.path + } + + const Component = matchedRoute.components.default if (Component && Component.options) { const { options } = Component