From 8b44afe5e547612c5922e8a76dbf2f1ade5ceb23 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 9 Dec 2022 15:44:57 +0100 Subject: [PATCH] [cleaning] avoid NPE --- .../eu/dnetlib/dhp/oa/graph/clean/cfhb/CleanCfHbSparkJob.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/cfhb/CleanCfHbSparkJob.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/cfhb/CleanCfHbSparkJob.java index f48226d717..7cc26745b2 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/cfhb/CleanCfHbSparkJob.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/cfhb/CleanCfHbSparkJob.java @@ -157,7 +157,8 @@ public class CleanCfHbSparkJob { r.getInstance().stream().map(Instance::getHostedby).map(KeyValue::getKey), r.getInstance().stream().map(Instance::getCollectedfrom).map(KeyValue::getKey))) .distinct() - .map(s -> asIdCfHbMapping(r.getId(), s)) + .filter(StringUtils::isNotBlank) + .map(cfHb -> asIdCfHbMapping(r.getId(), cfHb)) .iterator(); }