forked from D-Net/dnet-hadoop
[dedup] avoiding NPEs handling OpenOrg relations
This commit is contained in:
parent
72dcadd8e6
commit
511c0521e5
|
@ -6,6 +6,7 @@ import java.io.Serializable;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -137,7 +138,8 @@ abstract class AbstractSparkAction implements Serializable {
|
||||||
.map(
|
.map(
|
||||||
c -> c
|
c -> c
|
||||||
.stream()
|
.stream()
|
||||||
.filter(kv -> kv.getValue().equals(ModelConstants.OPENORGS_NAME))
|
.filter(Objects::nonNull)
|
||||||
|
.filter(kv -> ModelConstants.OPENORGS_NAME.equals(kv.getValue()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.isPresent())
|
.isPresent())
|
||||||
.orElse(false);
|
.orElse(false);
|
||||||
|
|
Loading…
Reference in New Issue