fix the undefined object call func

This commit is contained in:
zhijia,.zhang
2015-01-23 15:02:37 +08:00
parent c85730e32b
commit d4c841a459

View File

@@ -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;