Skip to content

Commit

Permalink
Merge pull request #5982 from IQSS/5981-index-fails-for-empty-date-fi…
Browse files Browse the repository at this point in the history
…elds

#5981 check for empty value array
  • Loading branch information
kcondon authored Jul 10, 2019
2 parents dcb6ca1 + c344b3b commit 1b073e3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,10 @@ private String addOrUpdateDataset(IndexableDataset indexableDataset, Set<Long> d
// no-op. we want to keep email address out of Solr per
// https://github.com/IQSS/dataverse/issues/759
} else if (dsfType.getSolrField().getSolrType().equals(SolrField.SolrType.DATE)) {
String dateAsString = dsf.getValues_nondisplay().get(0);
String dateAsString = "";
if (!dsf.getValues_nondisplay().isEmpty()) {
dateAsString = dsf.getValues_nondisplay().get(0);
}
logger.fine("date as string: " + dateAsString);
if (dateAsString != null && !dateAsString.isEmpty()) {
SimpleDateFormat inputDateyyyy = new SimpleDateFormat("yyyy", Locale.ENGLISH);
Expand Down

0 comments on commit 1b073e3

Please sign in to comment.