[dedup] avoiding NPEs handling OpenOrg relations

This commit is contained in:
Claudio Atzori 2021-04-12 17:45:11 +02:00
parent 72dcadd8e6
commit 511c0521e5
1 changed files with 3 additions and 1 deletions

View File

@ -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);