Skip to content

Commit

Permalink
hotfix: nullpointer when retrieve WorkContracts on retrievemail method (
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf authored Aug 23, 2024
1 parent eb529b4 commit 8e78cb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/swagger_detect_quarkus_ms.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Swagger Detect Conflict and Update Onboarding MS
name: Swagger Detect Conflict and Update
on:
pull_request:
branches:
Expand Down
2 changes: 1 addition & 1 deletion apps/user-group-ms/app/src/main/docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"paths" : {
"/v1/user-groups" : {
"get" : {
"tags" : [ "UserGroup", "external-v2", "support", "support-pnpg" ],
"tags" : [ "UserGroup", "external-pnpg", "external-v2", "support", "support-pnpg" ],
"summary" : "getUserGroups",
"description" : "Service that allows to get a list of UserGroup entities",
"operationId" : "getUserGroupsUsingGET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ private StringWriter getContent(String templateName, Map<String, String> dataMod
}

private static String retrieveMail(UserResource user, UserInstitution institution) {
WorkContactResource certEmail = user.getWorkContacts().getOrDefault(institution.getUserMailUuid(), null);
WorkContactResource certEmail = Optional.ofNullable(user.getWorkContacts())
.map(wc -> wc.getOrDefault(institution.getUserMailUuid(), null))
.orElse(null);
String email;
if (certEmail == null || certEmail.getEmail() == null || StringUtils.isBlank(certEmail.getEmail().getValue())) {
throw new InvalidRequestException("Missing mail for userId: " + user.getId());
Expand Down

0 comments on commit 8e78cb3

Please sign in to comment.