diff --git a/orcid-core/src/main/java/org/orcid/core/utils/v3/SourceUtils.java b/orcid-core/src/main/java/org/orcid/core/utils/v3/SourceUtils.java index a2eeb5af8f1..04f10cac2bc 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/v3/SourceUtils.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/v3/SourceUtils.java @@ -311,9 +311,12 @@ public void setSourceName(ResearchResources rr) { public static boolean isSelfAsserted(Source source, String orcid) { String sourceId = source.retrieveSourcePath(); - String assertionOriginSourceId = source.retrieveAssertionOriginPath(); + String assertionOriginOrcid = null; + if (source.getAssertionOriginOrcid() != null && source.getAssertionOriginOrcid().getPath() != null) { + assertionOriginOrcid = source.getAssertionOriginOrcid().getPath(); + } // If the affiliation source is the user himself or any member with OBO, then, it is considered self asserted - if(orcid.equals(sourceId) || orcid.equals(assertionOriginSourceId)) { + if(orcid.equals(sourceId) || orcid.equals(assertionOriginOrcid)) { return false; } else { return true;