diff --git a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/AbstractSparkAction.java b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/AbstractSparkAction.java index e8e67567ba..647a1b9c89 100644 --- a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/AbstractSparkAction.java +++ b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/AbstractSparkAction.java @@ -6,6 +6,7 @@ import java.io.Serializable; import java.io.StringReader; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; @@ -137,7 +138,8 @@ abstract class AbstractSparkAction implements Serializable { .map( c -> c .stream() - .filter(kv -> kv.getValue().equals(ModelConstants.OPENORGS_NAME)) + .filter(Objects::nonNull) + .filter(kv -> ModelConstants.OPENORGS_NAME.equals(kv.getValue())) .findFirst() .isPresent()) .orElse(false);