From 3329b6ce6bdccdab25c4bb900cc8ad4f78d8c77c Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 29 Jul 2022 10:54:20 +0200 Subject: [PATCH] [EOSC TAG] added fix for NPE on subjects --- .../src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java index 736496641..a96e6a3bc 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/eosc/SparkEoscTag.java @@ -183,6 +183,8 @@ public class SparkEoscTag { } private static boolean containsCriteriaNotebook(Software s) { + if(!Optional.ofNullable(s.getSubject()).isPresent()) + return false; if (s.getSubject().stream().anyMatch(sbj -> sbj.getValue().toLowerCase().contains("jupyter"))) return true; if (s