From cd379eb5e324ade3ee6ff2448e2cb18870bca490 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Mon, 25 Jan 2021 18:11:49 +0100 Subject: [PATCH] [Cleaning] trying to avoid NPEs, this time by ruling out authors without a defined fullname --- .../eu/dnetlib/dhp/oa/graph/clean/CleaningFunctions.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/CleaningFunctions.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/CleaningFunctions.java index 1d0e35125..7a12a92d6 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/CleaningFunctions.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/clean/CleaningFunctions.java @@ -190,6 +190,15 @@ public class CleaningFunctions { } } if (Objects.nonNull(r.getAuthor())) { + r + .setAuthor( + r + .getAuthor() + .stream() + .filter(a -> Objects.nonNull(a)) + .filter(a -> StringUtils.isNotBlank(StringUtils.trim(a.getFullname()))) + .collect(Collectors.toList())); + boolean nullRank = r .getAuthor() .stream()