This commit is contained in:
Efstratios Giannopoulos 2024-05-16 10:55:02 +03:00
parent 5a504dfcb3
commit 07ffeba068
1 changed files with 1 additions and 2 deletions

View File

@ -59,7 +59,6 @@ public class DmpRDAMapper{
if (dmp.getUpdatedAt() == null) throw new MyApplicationException("DMP Modified is missing");
if (dmp.getLabel() == null) throw new MyApplicationException("DMP Label is missing");
if (dmp.getProperties() == null) throw new MyApplicationException("DMP is missing language and contact properties");
if (dmp.getDescriptions() == null || dmp.getDescriptions().isEmpty()) throw new MyApplicationException("DMP has no Datasets");
List<ReferenceModel> grants = this.getReferenceModelOfTypeCode(dmp, this.rdaFileTransformerServiceProperties.getGrantReferenceCode());
List<ReferenceModel> researchers = this.getReferenceModelOfTypeCode(dmp, this.rdaFileTransformerServiceProperties.getResearcherReferenceCode());
@ -144,7 +143,7 @@ public class DmpRDAMapper{
Map<String, Object> datasetExtraData = new HashMap<>();
datasetExtraData.put("dmp", rda);
rda.setDataset(dmp.getDescriptions().stream().map(dataset -> datasetRDAMapper.toRDA(dataset, datasetExtraData)).toList());
rda.setDataset(dmp.getDescriptions() == null ? new ArrayList<>() : dmp.getDescriptions().stream().map(dataset -> datasetRDAMapper.toRDA(dataset, datasetExtraData)).toList());
return rda;
}