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 554958935..1d3210bff 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 @@ -735,8 +735,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);