From 34580f917fa6d2a67cb2b84cdc5124bd032a4701 Mon Sep 17 00:00:00 2001 From: Aldo Mihasi Date: Fri, 22 Sep 2023 12:57:47 +0300 Subject: [PATCH] check if grant exists in word/pdf export --- .../eu/eudat/logic/utilities/documents/word/WordBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/WordBuilder.java b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/WordBuilder.java index a10cf44d8..dea584ddd 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/WordBuilder.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/utilities/documents/word/WordBuilder.java @@ -1092,7 +1092,7 @@ public class WordBuilder { XWPFTable tbl = document.getTables().get(0); Iterator it = tbl.getRows().iterator(); it.next(); // skip first row - if(it.hasNext()){ + if(it.hasNext() && dmpEntity.getGrant() != null){ XWPFParagraph p = it.next().getCell(0).getParagraphs().get(0); XWPFRun run = p.createRun(); run.setText(dmpEntity.getGrant().getFunder().getLabel()); @@ -1101,7 +1101,7 @@ public class WordBuilder { } it = tbl.getRows().iterator(); it.next(); - if(it.hasNext()){ + if(it.hasNext() && dmpEntity.getGrant() != null){ XWPFParagraph p = it.next().getCell(1).getParagraphs().get(0); XWPFRun run = p.createRun(); String text = dmpEntity.getGrant().getLabel();