Fix NPE on whoami with unknown Realm (#33912)

Closes #33907

Signed-off-by: Oliver Cremerius <antikalk@users.noreply.github.com>
This commit is contained in:
Oliver 2024-10-15 08:22:59 +02:00 committed by GitHub
parent b95d12a968
commit 936cf68050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -291,7 +291,11 @@ public class AdminConsole {
private void addMasterRealmAccess(UserModel user, String currentRealm, Map<String, Set<String>> realmAdminAccess) {
final RealmModel realm = session.realms().getRealmByName(currentRealm);
if (realm != null) {
getRealmAdminAccess(realm, realm.getMasterAdminClient(), user, realmAdminAccess);
} else {
throw new NotFoundException("Realm not found");
}
}
private void getRealmAdminAccess(RealmModel realm, ClientModel client, UserModel user, Map<String, Set<String>> realmAdminAccess) {