From c3ecabd8e8cc6f00115ddb3b2786fc41b840f690 Mon Sep 17 00:00:00 2001 From: Sandro La Bruzzo Date: Wed, 26 Feb 2020 14:40:02 +0100 Subject: [PATCH] fixed NPE --- .../src/main/java/eu/dnetlib/dhp/provision/scholix/Scholix.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/Scholix.java b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/Scholix.java index 9ef2be2be..f84aab962 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/Scholix.java +++ b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/Scholix.java @@ -33,7 +33,7 @@ public class Scholix implements Serializable { Relation rel = mapper.readValue(relation, Relation.class); final Scholix s = new Scholix(); if (scholixSummary.getDate() != null) - s.setPublicationDate(scholixSummary.getDate().stream().findFirst().orElse(null)); + s.setPublicationDate(scholixSummary.getDate().stream().findAny().orElse(null)); s.setLinkprovider(rel.getCollectedFrom().stream().map(cf -> new ScholixEntityId(cf.getValue(), Collections.singletonList( new ScholixIdentifier(cf.getKey(), "dnet_identifier")