diff --git a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java index 94f88743e..45082de90 100644 --- a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java @@ -1026,8 +1026,8 @@ public class UserServiceImpl implements UserService { if (contactInfoEntity != null){ userId = contactInfoEntity.getUserId(); } - if (userId != this.userScope.getUserId()) throw new MyApplicationException("Cannot confirm invitation for different User"); if (userId != null) { + if (!userId.equals(this.userScope.getUserId())) throw new MyApplicationException("Cannot confirm invitation for different User"); UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first(); if (userCredential == null) throw new MyApplicationException();