mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-21 14:30:05 -06:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user