[Cleaning] trying to avoid NPEs

This commit is contained in:
Claudio Atzori 2021-01-25 13:36:01 +01:00
parent 646dab7f68
commit 07a0ccfc96
1 changed files with 10 additions and 6 deletions

View File

@ -59,12 +59,16 @@ public class CleaningFunctions {
} }
} }
if (Objects.nonNull(r.getAuthor())) { if (Objects.nonNull(r.getAuthor())) {
r.getAuthor().forEach(a -> { r.getAuthor()
if (Objects.nonNull(a.getPid())) { .stream()
a.getPid().forEach(p -> { .filter(Objects::nonNull)
fixVocabName(p.getQualifier(), ModelConstants.DNET_PID_TYPES); .forEach(a -> {
}); if (Objects.nonNull(a.getPid())) {
} a.getPid()
.stream()
.filter(Objects::nonNull)
.forEach(p -> fixVocabName(p.getQualifier(), ModelConstants.DNET_PID_TYPES));
}
}); });
} }
if (value instanceof Publication) { if (value instanceof Publication) {