diff --git a/metis-indexing/src/main/java/eu/europeana/indexing/solr/SolrDocumentPopulator.java b/metis-indexing/src/main/java/eu/europeana/indexing/solr/SolrDocumentPopulator.java index 22f5e9889..aa1263d12 100644 --- a/metis-indexing/src/main/java/eu/europeana/indexing/solr/SolrDocumentPopulator.java +++ b/metis-indexing/src/main/java/eu/europeana/indexing/solr/SolrDocumentPopulator.java @@ -198,9 +198,15 @@ private void populateWithDateRanges(SolrInputDocument document, RdfWrapper rdfWr final ProxyType europeanaProxy = rdfWrapper.getProxies().stream().filter(RdfWrapper::isEuropeanaProxy).findFirst() .orElseThrow(); - final List proxyChoiceLinks = europeanaProxy.getChoiceList().stream().filter(choiceTypePredicate) - .map(choiceValueGetter).map(ResourceOrLiteralType::getResource) - .map(Resource::getResource).toList(); + final List proxyChoiceLinks = europeanaProxy.getChoiceList().stream() + .filter(choiceTypePredicate) + .map(choiceValueGetter) + .filter(Objects::nonNull) + .map(ResourceOrLiteralType::getResource) + .filter(Objects::nonNull) + .map(Resource::getResource) + .filter(Objects::nonNull) + .toList(); final List proxyChoiceMatchingTimeSpans = normalizedTimeSpans.stream().filter( timeSpanType -> proxyChoiceLinks.contains(timeSpanType.getAbout())).toList(); diff --git a/metis-media-service/src/main/java/eu/europeana/metis/mediaprocessing/model/EnrichedRdfImpl.java b/metis-media-service/src/main/java/eu/europeana/metis/mediaprocessing/model/EnrichedRdfImpl.java index 7f88ab131..c2d5619e1 100644 --- a/metis-media-service/src/main/java/eu/europeana/metis/mediaprocessing/model/EnrichedRdfImpl.java +++ b/metis-media-service/src/main/java/eu/europeana/metis/mediaprocessing/model/EnrichedRdfImpl.java @@ -33,7 +33,7 @@ private WebResource getOrCreateWebResource(String url) { getRdf().setWebResourceList(new ArrayList<>()); } for (WebResourceType resource : getRdf().getWebResourceList()) { - if (resource.getAbout().equals(url)) { + if (resource != null && resource.getAbout() !=null && resource.getAbout().equals(url)) { return new WebResource(resource); } }