From 2541cc7258f370735ad8f076524242163a31d3f8 Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Mon, 7 Oct 2024 09:54:02 +0300 Subject: [PATCH] description reference persist small fix --- .../opencdmp/service/description/DescriptionServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java index f21eb65a7..8bd44b609 100644 --- a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java @@ -696,8 +696,8 @@ public class DescriptionServiceImpl implements DescriptionService { if (!this.conventionService.isListNullOrEmpty(fieldPersist.getReferences())) { List usedReferences = new ArrayList<>(); for (ReferencePersist referencePersist : fieldPersist.getReferences()) { - if (usedReferences.contains(referencePersist.getId())) continue; - usedReferences.add(referencePersist.getId()); + if (referencePersist.getId() != null && usedReferences.contains(referencePersist.getId())) continue; + if (referencePersist.getId() != null) usedReferences.add(referencePersist.getId()); DescriptionReferencePersist descriptionReferencePersist = new DescriptionReferencePersist(); descriptionReferencePersist.setData(new DescriptionReferenceDataPersist()); descriptionReferencePersist.getData().setFieldId(fieldId);