KEYCLOAK-19371 - fix for UI crash when logged in user has access to (#9088)

multiple realms and at the same time that user has only limited role
(eg: view-users) which does not allow to see realm details. Crash was
happening on switching the realm.
This commit is contained in:
aznamier 2021-12-15 02:10:50 +07:00 committed by GitHub
parent 74970ac043
commit 04da528b35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -280,7 +280,10 @@ module.controller('RealmDetailCtrl', function($scope, Current, Realm, realm, ser
}
}
$scope.realm = angular.copy(realm);
$scope.realm.attributes['userProfileEnabled'] = $scope.realm.attributes['userProfileEnabled'] == 'true';
if ($scope.realm.attributes != null) {
$scope.realm.attributes['userProfileEnabled'] = $scope.realm.attributes['userProfileEnabled'] == 'true';
}
var oldCopy = angular.copy($scope.realm);
$scope.realmCopy = oldCopy;