From a0b74399c4f1a7754029e1fd7f4be3b20836404a Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Thu, 17 Sep 2015 12:32:30 -0400 Subject: made sure we force remove modal only if it is valid --- www/js/MonitorCtrl.js | 2 +- www/js/MontageCtrl.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'www') diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 2b1d1e9e..2ed75ee1 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -198,7 +198,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopu $scope.$on('$ionicView.leave', function () { console.log("**VIEW ** Monitor Ctrl Left, force removing modal"); - $scope.modal.remove(); + if ($scope.modal) $scope.modal.remove(); }); $scope.$on('$ionicView.unloaded', function () { diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 53246bb9..85604dcf 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -711,7 +711,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $scope.$on('$ionicView.leave', function () { console.log("**VIEW ** Montage Ctrl Left, force removing modal"); - $scope.modal.remove(); + if ($scope.modal) $scope.modal.remove(); }); $scope.$on('$ionicView.unloaded', function () { -- cgit v1.2.3