added check if author.pid exists or is null

This commit is contained in:
Miriam Baglioni 2020-05-01 15:09:02 +02:00
parent 13f30664ea
commit b7dd400e51
1 changed files with 5 additions and 1 deletions

View File

@ -187,7 +187,11 @@ public class SparkOrcidToResultFromSemRelJob3 {
}
private static boolean containsAllowedPid(Author a) {
for (StructuredProperty pid : a.getPid()) {
Optional<List<StructuredProperty>> pids = Optional.ofNullable(a.getPid());
if (!pids.isPresent()) {
return false;
}
for (StructuredProperty pid : pids.get()) {
if (PROPAGATION_AUTHOR_PID.equals(pid.getQualifier().getClassid())) {
return true;
}