tuwien-csd / damap-backend

MIT License
5 stars 6 forks source link

Document export error when no cost description is present #251

Closed rekt-hard closed 2 months ago

rekt-hard commented 2 months ago

Describe the bug Document can not be exported, when a cost with no description is present.

Is this a regression? Yes

Steps to Reproduce

  1. Create a DMP
  2. Specify datasets to be able to edit other steps
  3. Go to step 10 (costs)
  4. Create a cost but leave the description field empty
  5. Export document (any template)
  6. Observe error message flash

Expected behavior Document should be exported correctly.

Screenshots If applicable, add screenshots to help explain your problem.

Environment

Additional context Stacktrace

Caused by: java.lang.NullPointerException: Cannot invoke "String.lines()" because the return value of "java.util.ArrayList.get(int)" is null
    at org.damap.base.conversion.AbstractTemplateExportFunctions.insertTableCells(AbstractTemplateExportFunctions.java:173)
    at org.damap.base.conversion.AbstractTemplateExportScienceEuropeComponents.composeTableCost(AbstractTemplateExportScienceEuropeComponents.java:1300)
    at org.damap.base.conversion.AbstractTemplateExportScienceEuropeComponents.tableContent(AbstractTemplateExportScienceEuropeComponents.java:836)
    at org.damap.base.conversion.ExportHorizonEuropeTemplate.exportTemplate(ExportHorizonEuropeTemplate.java:58)
    at org.damap.base.conversion.ExportHorizonEuropeTemplate_ClientProxy.exportTemplate(Unknown Source)
    at org.damap.base.conversion.ExportTemplateBroker.exportTemplateByType(ExportTemplateBroker.java:71)
    at org.damap.base.conversion.ExportTemplateBroker.exportTemplate(ExportTemplateBroker.java:55)
    at org.damap.base.conversion.ExportTemplateBroker_ClientProxy.exportTemplate(Unknown Source)
    at org.damap.base.rest.DmpDocumentResource.exportTemplate(DmpDocumentResource.java:57)