diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java index 8e11165..601cee0 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java @@ -587,7 +587,9 @@ public class WordReportGenerationService { private int setText(XWPFTableCell cell, String value) { // Apache POI automatically adds an initial empty paragraph to a cell resulting in a break line. - cell.removeParagraph(0); + if (cell.getParagraphs() != null && !cell.getParagraphs().isEmpty()) { + cell.removeParagraph(0); + } cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); XWPFParagraph addParagraph = cell.addParagraph(); XWPFRun run = addParagraph.createRun();