Skip to content

Commit

Permalink
fix(jans-auth-server): NPE during client name rendering #10663
Browse files Browse the repository at this point in the history
Signed-off-by: YuriyZ <[email protected]>
  • Loading branch information
yuriyz committed Jan 16, 2025
1 parent 6c06ade commit 739ea16
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
@Named
public class AuthorizeAction {

public static final String UNKNOWN = "Unknown";
@Inject
private Logger log;

Expand Down Expand Up @@ -985,7 +986,7 @@ public String getClientDisplayName() {
log.trace("client {}", clientId);

if (StringUtils.isBlank(clientId)) {
return "Unknown";
return UNKNOWN;
}

final Client client = clientService.getClient(clientId);
Expand All @@ -994,15 +995,19 @@ public String getClientDisplayName() {

public String getClientDisplayName(final Client client) {
log.trace("client {}", client);

if (client == null) {
getClientDisplayName();
return UNKNOWN;
}

return getCheckedClientDisplayName(client);
}

private String getCheckedClientDisplayName(final Client client) {
if (client == null) {
return UNKNOWN;
}

if (StringUtils.isNotBlank(client.getClientName())) {
return client.getClientName();
}
Expand All @@ -1011,7 +1016,7 @@ private String getCheckedClientDisplayName(final Client client) {
return client.getClientId();
}

return "Unknown";
return UNKNOWN;
}

public String getAuthReqId() {
Expand Down

0 comments on commit 739ea16

Please sign in to comment.