From b7dd400e5175ca7366ff8d98378ec8bfc8cf9ba3 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 1 May 2020 15:09:02 +0200 Subject: [PATCH] added check if author.pid exists or is null --- .../SparkOrcidToResultFromSemRelJob3.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/orcidtoresultfromsemrel/SparkOrcidToResultFromSemRelJob3.java b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/orcidtoresultfromsemrel/SparkOrcidToResultFromSemRelJob3.java index 997b58bf2a..4611eac394 100644 --- a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/orcidtoresultfromsemrel/SparkOrcidToResultFromSemRelJob3.java +++ b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/orcidtoresultfromsemrel/SparkOrcidToResultFromSemRelJob3.java @@ -187,7 +187,11 @@ public class SparkOrcidToResultFromSemRelJob3 { } private static boolean containsAllowedPid(Author a) { - for (StructuredProperty pid : a.getPid()) { + Optional> 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; }