From 646dab7f680f641f9600b231920f1f624b7f2bcc Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 22 Jan 2021 18:24:34 +0100 Subject: [PATCH] trying to avoid NPEs --- .../src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java index 0026ee9aa..845c4c982 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java @@ -323,13 +323,13 @@ public class Result extends OafEntity implements Serializable { if (a.size() == b.size()) { int msa = a .stream() - .filter(i -> i.getValue() != null) + .filter(i -> i != null && i.getValue() != null) .map(i -> i.getValue().length()) .max(Comparator.naturalOrder()) .orElse(0); int msb = b .stream() - .filter(i -> i.getValue() != null) + .filter(i -> i != null && i.getValue() != null) .map(i -> i.getValue().length()) .max(Comparator.naturalOrder()) .orElse(0);