check if CouId is null

This commit is contained in:
Konstantinos Spyrou 2023-01-19 13:41:11 +02:00
parent 415bb1e197
commit 125b64ec3b
1 changed files with 3 additions and 1 deletions

View File

@ -176,7 +176,9 @@ public class AuthorizationServiceImpl implements AuthorizationService {
int coPersonId = aaiRegistryService.getCoPersonIdByEmail(email);
List<Integer> list = new ArrayList<>();
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();
}