diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelTemplateReportGenerationService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelTemplateReportGenerationService.java index 624c35f..f09b63d 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelTemplateReportGenerationService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ExcelTemplateReportGenerationService.java @@ -78,12 +78,15 @@ public class ExcelTemplateReportGenerationService { for (DossierAttributeConfig attribute : dossierAttributesConfig.getDossierAttributeConfigs()) { if (dossierAttribute.getDossierAttributeId().equals(attribute.getId())) { if (attribute.getType().equals(DossierAttributeConfig.DossierAttributeType.IMAGE)) { - if (dossierAttribute.getValue().startsWith("data:")) { - imagePlaceholders.add(new ImagePlaceholder(attribute.getPlaceholder(), Base64.getDecoder() - .decode(dossierAttribute.getValue().split(",")[1]))); - } else { - imagePlaceholders.add(new ImagePlaceholder(attribute.getPlaceholder(), Base64.getDecoder() - .decode(dossierAttribute.getValue()))); + + if(dossierAttribute.getValue() != null) { + if (dossierAttribute.getValue().startsWith("data:")) { + imagePlaceholders.add(new ImagePlaceholder(attribute.getPlaceholder(), Base64.getDecoder() + .decode(dossierAttribute.getValue().split(",")[1]))); + } else { + imagePlaceholders.add(new ImagePlaceholder(attribute.getPlaceholder(), Base64.getDecoder() + .decode(dossierAttribute.getValue()))); + } } } else { dossierAttributesPlaceholder.put(attribute.getPlaceholder(), dossierAttribute.getValue()); 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 ad6f7e3..835bf9e 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 @@ -98,12 +98,14 @@ public class WordReportGenerationService { if (dossierAttribute.getDossierAttributeId().equals(attributeConfig.getId())) { if (attributeConfig.getType().equals(DossierAttributeConfig.DossierAttributeType.IMAGE)) { - if (dossierAttribute.getValue().startsWith("data:")) { - imagePlaceholders.add(new ImagePlaceholder(attributeConfig.getPlaceholder(), Base64.getDecoder() - .decode(dossierAttribute.getValue().split(",")[1]))); - } else { - imagePlaceholders.add(new ImagePlaceholder(attributeConfig.getPlaceholder(), Base64.getDecoder() - .decode(dossierAttribute.getValue()))); + if(dossierAttribute.getValue() != null) { + if (dossierAttribute.getValue().startsWith("data:")) { + imagePlaceholders.add(new ImagePlaceholder(attributeConfig.getPlaceholder(), Base64.getDecoder() + .decode(dossierAttribute.getValue().split(",")[1]))); + } else { + imagePlaceholders.add(new ImagePlaceholder(attributeConfig.getPlaceholder(), Base64.getDecoder() + .decode(dossierAttribute.getValue()))); + } } } else { dossierAttributesPlaceholder.put(attributeConfig.getPlaceholder(), dossierAttribute.getValue());