From 9bc6a2e8d1e5fb20a2e9e910d5cdd9f5e1f77999 Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Thu, 16 May 2024 10:39:08 +0300 Subject: [PATCH] bug fix --- .../service/prefillingsource/PrefillingSourceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java index 314676784..b83933983 100644 --- a/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/prefillingsource/PrefillingSourceServiceImpl.java @@ -421,7 +421,7 @@ public class PrefillingSourceServiceImpl implements PrefillingSourceService { if (!this.conventionService.isListNullOrEmpty(issuedFieldEntities)) { String issuedIdNode = issuedFieldEntities.getFirst().getId(); String issuedValue = this.conventionService.isNullOrEmpty(issuedIdNode) ? null : description.getProperties().getFieldSets().values().stream().map(PropertyDefinitionFieldSet::getItems).flatMap(List::stream) - .filter(x -> x.getFields() != null && x.getFields().containsKey(issuedIdNode)).map(x -> x.getFields().get(issuedIdNode).getTextValue()).findFirst().orElse(null); + .filter(x -> x.getFields() != null && x.getFields().containsKey(issuedIdNode)).map(x -> x.getFields().get(issuedIdNode).getTextValue()).filter(Objects::nonNull).findFirst().orElse(null); if (!this.conventionService.isNullOrEmpty(issuedValue)) { List licStartFieldSetsEntities = definition.getAllFieldSets().stream().filter(x -> x.getAllField() != null && x.getAllField().stream().anyMatch(y -> y.getSchematics() != null && y.getSchematics().contains("rda.dataset.distribution.license.start_date"))).toList();