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);