diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java index 8d38301b7..e9f347342 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java @@ -119,8 +119,10 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer .where((builder, root) -> builder.and(builder.equal(root.get("provider"), profile.getProvider().getValue()), builder.equal(root.get("externalId"), profile.getId()))) .getSingleOrDefault()); userInfo = optionalCredential.map(Credential::getUserInfo).orElse(null); - if (userInfo.getUserStatus() == 1) { - userInfo = null; + if (userInfo != null) { + if (userInfo.getUserStatus() == 1) { + userInfo = null; + } } //} if (userInfo == null) {