From 1af4224d3dc5ab9eac7f197b58afa4e5d06af87a Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Sun, 26 May 2024 15:43:24 +0200 Subject: [PATCH] [org dedup] avoid NPEs in SparkPrepareOrgRels --- .../main/java/eu/dnetlib/dhp/oa/dedup/SparkPrepareOrgRels.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/SparkPrepareOrgRels.java b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/SparkPrepareOrgRels.java index 61325ab502..4fea61c18a 100644 --- a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/SparkPrepareOrgRels.java +++ b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/SparkPrepareOrgRels.java @@ -217,7 +217,7 @@ public class SparkPrepareOrgRels extends AbstractSparkAction { final Organization o = r._2()._2(); return new OrgSimRel( r._1()._1(), - o.getOriginalId().get(0), + Optional.ofNullable(o.getOriginalId()).map(oid -> oid.get(0)).orElse(null), Optional.ofNullable(o.getLegalname()).map(Field::getValue).orElse(""), Optional.ofNullable(o.getLegalshortname()).map(Field::getValue).orElse(""), Optional.ofNullable(o.getCountry()).map(Qualifier::getClassid).orElse(""),