Check if scope is already destroyed

This commit is contained in:
Girish Ramakrishnan
2019-01-06 15:09:02 -08:00
parent fbc494abc9
commit 67415ff715

View File

@@ -298,6 +298,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
function getSubscription() {
AppStore.getSubscription($scope.appstoreConfig, function (error, result) {
if (error) return console.error(error);
if (!$scope.$parent) return; // user changed view. otherwise we get an error that $scope.$parent is null
$scope.subscription = result;