Skip to content

Commit

Permalink
Treat missing contrib type as Other
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Sep 14, 2024
1 parent 93708be commit 7668d70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ private void writeContributors(XMLStreamWriter xmlw, DvObject dvObject) throws X
}
// QDR - doesn't have Funder in the contributor type list.
// Using a string isn't i18n
if (StringUtils.isNotBlank(contributor) && StringUtils.isNotBlank(contributorType) && !StringUtils.equalsIgnoreCase("Funder", contributorType)) {
if (StringUtils.isNotBlank(contributor) && !StringUtils.equalsIgnoreCase("Funder", contributorType)) {
contributorType = getCanonicalContributorType(contributorType);
contributorsCreated = XmlWriterUtil.writeOpenTagIfNeeded(xmlw, "contributors", contributorsCreated);
JsonObject entityObject = PersonOrOrgUtil.getPersonOrOrganization(contributor, false, false);
Expand All @@ -578,7 +578,7 @@ private void writeContributors(XMLStreamWriter xmlw, DvObject dvObject) throws X
"RelatedPerson", "ResearchGroup", "RightsHolder", "Researcher", "Sponsor", "Supervisor", "WorkPackageLeader"));

private String getCanonicalContributorType(String contributorType) {
if(!contributorTypes.contains(contributorType)) {
if(StringUtils.isBlank(contributorType) || !contributorTypes.contains(contributorType)) {
return "Other";
}
return contributorType;
Expand Down

0 comments on commit 7668d70

Please sign in to comment.