From 332571a15416bf7371be4fec01a863323dae74fa Mon Sep 17 00:00:00 2001 From: amontenegro Date: Tue, 19 Dec 2023 13:47:06 -0600 Subject: [PATCH] Check for orcidaware entity --- .../orcid/core/utils/SourceEntityUtils.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/orcid-core/src/main/java/org/orcid/core/utils/SourceEntityUtils.java b/orcid-core/src/main/java/org/orcid/core/utils/SourceEntityUtils.java index 69a93843665..ddf3ff0b336 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/SourceEntityUtils.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/SourceEntityUtils.java @@ -103,14 +103,16 @@ public static Source extractSourceFromEntity(SourceAwareEntity e, ClientDetai // client if (!StringUtils.isEmpty(e.getClientSourceId())) { source.setSourceClientId(new SourceClientId(e.getClientSourceId())); - ClientDetailsEntity clientSource = clientDetailsEntityCacheManager.retrieve(e.getClientSourceId()); - if (clientSource.isUserOBOEnabled()) { - String orcidId = null; - if (e instanceof OrcidAware) { - orcidId = ((OrcidAware) e).getOrcid(); - } - source.setAssertionOriginOrcid(new SourceOrcid(orcidId)); - } + if(e instanceof OrcidAware) { + ClientDetailsEntity clientSource = clientDetailsEntityCacheManager.retrieve(e.getClientSourceId()); + if (clientSource.isUserOBOEnabled()) { + String orcidId = null; + if (e instanceof OrcidAware) { + orcidId = ((OrcidAware) e).getOrcid(); + } + source.setAssertionOriginOrcid(new SourceOrcid(orcidId)); + } + } } // member obo