From 04da528b3517a38773c7f3afad1545cd4d1372a9 Mon Sep 17 00:00:00 2001 From: aznamier Date: Wed, 15 Dec 2021 02:10:50 +0700 Subject: [PATCH] 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. --- .../theme/base/admin/resources/js/controllers/realm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 768bac77ce..c10c12db6f 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -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;