From d4c841a4598747cb874c2a17a584310540a3346f Mon Sep 17 00:00:00 2001 From: "zhijia,.zhang" Date: Fri, 23 Jan 2015 15:02:37 +0800 Subject: [PATCH] fix the undefined object call func --- js/angular/service/history.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/angular/service/history.js b/js/angular/service/history.js index e886146c29..2541825535 100644 --- a/js/angular/service/history.js +++ b/js/angular/service/history.js @@ -313,7 +313,8 @@ function($rootScope, $state, $location, $window, $timeout, $ionicViewSwitcher, $ // the forward has a history for (x = tmp.stack.length - 1; x >= forwardView.index; x--) { // starting from the end destroy all forwards in this history from this point - tmp.stack[x].destroy(); + var stack_x = tmp.stack[x]; + stack_x && stack_x.destroy && stack_x.destroy(); tmp.stack.splice(x); } historyId = forwardView.historyId;