File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -263,9 +263,11 @@ function extractUpdateHooks (updated: Array<RouteRecord>): Array<?Function> {
263263 return extractGuards ( updated , 'beforeRouteUpdate' , bindGuard )
264264}
265265
266- function bindGuard ( guard : NavigationGuard , instance : _Vue ) : NavigationGuard {
267- return function boundRouteGuard ( ) {
268- return guard . apply ( instance , arguments )
266+ function bindGuard ( guard : NavigationGuard , instance : ?_Vue ) : ?NavigationGuard {
267+ if ( instance ) {
268+ return function boundRouteGuard ( ) {
269+ return guard . apply ( instance , arguments )
270+ }
269271 }
270272}
271273
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ describe('error handling', () => {
88 const router = new VueRouter ( )
99 const err = new Error ( 'foo' )
1010 router . beforeEach ( ( ) => { throw err } )
11+ router . onError ( ( ) => { } )
1112
1213 const onReady = jasmine . createSpy ( 'ready' )
1314 const onError = jasmine . createSpy ( 'error' )
You can’t perform that action at this time.
0 commit comments