From ea97ff0ba01a68133b2404b9ceb89795d6d56d27 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Mon, 9 Oct 2023 20:09:06 -0500 Subject: [PATCH] fix: Only compare assertion origin orcid in obo --- .../src/main/java/org/orcid/core/utils/v3/SourceUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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;