From 5d0f46651bfcca0ad265fc0955c954f95f7d811a Mon Sep 17 00:00:00 2001 From: Sandro La Bruzzo Date: Wed, 26 Feb 2020 14:31:34 +0100 Subject: [PATCH] fixed NPE --- .../eu/dnetlib/dhp/provision/scholix/ScholixResource.java | 8 +++++--- .../graph/Application/provision/oozie_app/workflow.xml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/ScholixResource.java b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/ScholixResource.java index 34becbb90..a08a2cd9b 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/ScholixResource.java +++ b/dhp-workflows/dhp-graph-provision/src/main/java/eu/dnetlib/dhp/provision/scholix/ScholixResource.java @@ -34,7 +34,9 @@ public class ScholixResource implements Serializable { resource.setObjectType(summary.getTypology().toString()); - resource.setTitle(summary.getTitle().stream().findAny().orElse(null)); + + if (summary.getTitle() != null) + resource.setTitle(summary.getTitle().stream().findAny().orElse(null)); if (summary.getAuthor() != null) resource.setCreator(summary.getAuthor().stream() @@ -53,8 +55,8 @@ public class ScholixResource implements Serializable { resource.setCollectedFrom(summary.getDatasources().stream() .map(d -> new ScholixCollectedFrom(new ScholixEntityId(d.getDatasourceName(), - Collections.singletonList(new ScholixIdentifier(d.getDatasourceId(), "dnet_identifier")) - ), "collected", d.getCompletionStatus())) + Collections.singletonList(new ScholixIdentifier(d.getDatasourceId(), "dnet_identifier")) + ), "collected", d.getCompletionStatus())) .collect(Collectors.toList())); return resource; diff --git a/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/graph/Application/provision/oozie_app/workflow.xml b/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/graph/Application/provision/oozie_app/workflow.xml index 300844807..8ce51069f 100644 --- a/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/graph/Application/provision/oozie_app/workflow.xml +++ b/dhp-workflows/dhp-graph-provision/src/main/resources/eu/dnetlib/dhp/graph/Application/provision/oozie_app/workflow.xml @@ -27,7 +27,7 @@ - + Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}] @@ -73,7 +73,7 @@ --workingDirPath${workingDirPath} --graphPath${graphPath} - +