check if grant exists in word/pdf export

This commit is contained in:
Bernaldo Mihasi 2023-09-22 12:57:47 +03:00
parent 56a70636c3
commit 34580f917f
1 changed files with 2 additions and 2 deletions

View File

@ -1092,7 +1092,7 @@ public class WordBuilder {
XWPFTable tbl = document.getTables().get(0);
Iterator<XWPFTableRow> 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();