Skip to content

Commit

Permalink
[ALS-5514] Evaluate user metadata with isNotBlank to handle the null …
Browse files Browse the repository at this point in the history
…case.

This was to fix getGeneralMetadata throwing NPE on isEmpty() if its null.
  • Loading branch information
Gcolon021 committed Jan 26, 2024
1 parent be17dcb commit 12dc442
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private User loadUser(JsonNode introspectResponse) {
}

// Add metadata to the user upon logging in if it doesn't exist
if (user.getGeneralMetadata().isEmpty()) {
if (StringUtils.isBlank(user.getGeneralMetadata())) {
logger.info("Adding metadata to user: " + user.getUuid());
// JsonNode is immutable, so we need to convert it to a ObjectNode
ObjectNode objectNode = JAXRSConfiguration.objectMapper.createObjectNode();
Expand Down

0 comments on commit 12dc442

Please sign in to comment.