diff --git a/src/main/java/eu/dnetlib/repo/manager/service/security/AuthorizationServiceImpl.java b/src/main/java/eu/dnetlib/repo/manager/service/security/AuthorizationServiceImpl.java index cd6812e..4ce5e70 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/security/AuthorizationServiceImpl.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/security/AuthorizationServiceImpl.java @@ -142,7 +142,9 @@ public class AuthorizationServiceImpl implements AuthorizationService { int coPersonId = aaiRegistryService.getCoPersonIdByEmail(email); List 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(); }