Skip to content

Commit e02565b

Browse files
committed
Merge pull request #2985 from jiahut/master
fix(history): prevent function call on undefined
2 parents 8c105ad + d4c841a commit e02565b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: js/angular/service/history.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ function($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $
313313
// the forward has a history
314314
for (x = tmp.stack.length - 1; x >= forwardView.index; x--) {
315315
// starting from the end destroy all forwards in this history from this point
316-
tmp.stack[x].destroy();
316+
var stack_x = tmp.stack[x];
317+
stack_x && stack_x.destroy && stack_x.destroy();
317318
tmp.stack.splice(x);
318319
}
319320
historyId = forwardView.historyId;

0 commit comments

Comments
 (0)