From acafc8297c914b779e2bdeb42825253a4851b2b6 Mon Sep 17 00:00:00 2001 From: hareku Date: Fri, 29 May 2020 15:08:14 +0900 Subject: [PATCH 1/2] fix: error.stack is possibly null --- src/history/errors.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/history/errors.js b/src/history/errors.js index 21f3f56f9..969f673ad 100644 --- a/src/history/errors.js +++ b/src/history/errors.js @@ -48,9 +48,12 @@ function createRouterError (from, to, type, message) { error.to = to error.type = type - const newStack = error.stack.split('\n') - newStack.splice(1, 2) // remove 2 last useless calls - error.stack = newStack.join('\n') + if (typeof error.stack === 'string') { + const newStack = error.stack.split('\n') + newStack.splice(1, 2) // remove 2 last useless calls + error.stack = newStack.join('\n') + } + return error } From f3a44d9734e8457044195411c4508dedb049324a Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 29 May 2020 09:00:41 +0200 Subject: [PATCH 2/2] Update src/history/errors.js --- src/history/errors.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/history/errors.js b/src/history/errors.js index 969f673ad..2d624e135 100644 --- a/src/history/errors.js +++ b/src/history/errors.js @@ -48,12 +48,6 @@ function createRouterError (from, to, type, message) { error.to = to error.type = type - if (typeof error.stack === 'string') { - const newStack = error.stack.split('\n') - newStack.splice(1, 2) // remove 2 last useless calls - error.stack = newStack.join('\n') - } - return error }