Skip to content

Commit

Permalink
Avoid a NullPointerException when client roles are associated with a …
Browse files Browse the repository at this point in the history
…client that no longer exists

Closes keycloak#34444

Signed-off-by: Giuseppe Graziano <[email protected]>
  • Loading branch information
graziang authored and mposolda committed Dec 2, 2024
1 parent faf36dd commit 8f417d6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ private static void addToToken(AccessToken token, RoleModel role) {

} else {
ClientModel app = (ClientModel) role.getContainer();
if (app == null) {
return;
}
access = token.getResourceAccess(app.getClientId());
if (access == null) {
access = token.addAccess(app.getClientId());
Expand Down

0 comments on commit 8f417d6

Please sign in to comment.