Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-auth-server): NPE during client name rendering #10663 #10664

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading