check if CouId is null #2

Merged
spyroukon merged 1 commits from develop into master 2023-01-19 14:40:37 +01:00
1 changed files with 3 additions and 1 deletions

View File

@ -142,7 +142,9 @@ public class AuthorizationServiceImpl implements AuthorizationService {
int coPersonId = aaiRegistryService.getCoPersonIdByEmail(email); int coPersonId = aaiRegistryService.getCoPersonIdByEmail(email);
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
for (JsonElement element : aaiRegistryService.getRolesWithStatus(coPersonId, AaiRegistryService.RoleStatus.ACTIVE)) { for (JsonElement element : aaiRegistryService.getRolesWithStatus(coPersonId, AaiRegistryService.RoleStatus.ACTIVE)) {
list.add(element.getAsJsonObject().get("CouId").getAsInt()); if (element.getAsJsonObject().get("CouId") != null) {
list.add(element.getAsJsonObject().get("CouId").getAsInt());
}
} }
return aaiRegistryService.getCouNames(list).values(); return aaiRegistryService.getCouNames(list).values();
} }