forked from D-Net/dnet-hadoop
[Cleaning] trying to avoid NPEs
This commit is contained in:
parent
07a0ccfc96
commit
3465c8ccee
|
@ -59,17 +59,19 @@ public class CleaningFunctions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(r.getAuthor())) {
|
if (Objects.nonNull(r.getAuthor())) {
|
||||||
r.getAuthor()
|
r
|
||||||
.stream()
|
.getAuthor()
|
||||||
.filter(Objects::nonNull)
|
.stream()
|
||||||
.forEach(a -> {
|
.filter(Objects::nonNull)
|
||||||
if (Objects.nonNull(a.getPid())) {
|
.forEach(a -> {
|
||||||
a.getPid()
|
if (Objects.nonNull(a.getPid())) {
|
||||||
.stream()
|
a
|
||||||
.filter(Objects::nonNull)
|
.getPid()
|
||||||
.forEach(p -> fixVocabName(p.getQualifier(), ModelConstants.DNET_PID_TYPES));
|
.stream()
|
||||||
}
|
.filter(Objects::nonNull)
|
||||||
});
|
.forEach(p -> fixVocabName(p.getQualifier(), ModelConstants.DNET_PID_TYPES));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (value instanceof Publication) {
|
if (value instanceof Publication) {
|
||||||
|
|
||||||
|
@ -208,6 +210,7 @@ public class CleaningFunctions {
|
||||||
a
|
a
|
||||||
.getPid()
|
.getPid()
|
||||||
.stream()
|
.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
.filter(p -> Objects.nonNull(p.getQualifier()))
|
.filter(p -> Objects.nonNull(p.getQualifier()))
|
||||||
.filter(p -> StringUtils.isNotBlank(p.getValue()))
|
.filter(p -> StringUtils.isNotBlank(p.getValue()))
|
||||||
.map(p -> {
|
.map(p -> {
|
||||||
|
|
Loading…
Reference in New Issue