mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Add a null check to ClientModels loaded by ID from ClientPolicyRepresentation.
Closes #37673 Signed-off-by: Garth <244253+xgp@users.noreply.github.com>
This commit is contained in:
parent
3f7a1ee5a6
commit
e0806c6284
@ -30,11 +30,12 @@ public class ClientPolicyProvider implements PolicyProvider {
|
||||
|
||||
for (String client : representation.getClients()) {
|
||||
ClientModel clientModel = realm.getClientById(client);
|
||||
|
||||
if (context.getAttributes().containsValue("kc.client.id", clientModel.getClientId())) {
|
||||
evaluation.grant();
|
||||
logger.debugf("Client policy %s matched with client %s and was granted", evaluation.getPolicy().getName(), clientModel.getClientId());
|
||||
return;
|
||||
if (clientModel != null) {
|
||||
if (context.getAttributes().containsValue("kc.client.id", clientModel.getClientId())) {
|
||||
evaluation.grant();
|
||||
logger.debugf("Client policy %s matched with client %s and was granted", evaluation.getPolicy().getName(), clientModel.getClientId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user