Skip to content

Commit

Permalink
an extra null check on TermsOfUse - this should fix #10513 for datase…
Browse files Browse the repository at this point in the history
…ts harvested in oai_dc, and not break anything else... I think? #8796
  • Loading branch information
landreev committed Jul 17, 2024
1 parent b42b14d commit 194b099
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1849,8 +1849,12 @@ private void addLicenseToSolrDoc(SolrInputDocument solrInputDocument, DatasetVer
}

String licenseName = "Custom Terms";
if(datasetVersion.getTermsOfUseAndAccess().getLicense() != null) {
if (datasetVersion.getTermsOfUseAndAccess().getLicense() != null) {
licenseName = datasetVersion.getTermsOfUseAndAccess().getLicense().getName();
} else if (datasetVersion.getTermsOfUseAndAccess().getTermsOfUse() == null) {
// this fixes #10513 for datasets harvested in oai_dc - these
// have neither the license id, nor any actual custom terms
return;
}
solrInputDocument.addField(SearchFields.DATASET_LICENSE, licenseName);
}
Expand Down

0 comments on commit 194b099

Please sign in to comment.