VictorPavfurious commented on code in PR #4697:
URL: https://github.com/apache/fineract/pull/4697#discussion_r2106661419


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/export/S3DatatableReportExportServiceImpl.java:
##########
@@ -51,9 +52,20 @@ public ResponseHolder export(String reportName, 
MultivaluedMap<String, String> q
                     isSelfServiceUserReport);
             try (ByteArrayOutputStream byteArrayOutputStream = new 
ByteArrayOutputStream()) {
                 output.write(byteArrayOutputStream);
+                byte[] fileBytes = byteArrayOutputStream.toByteArray();
+                if (fileBytes.length == 0) {
+                    throw new IllegalStateException("Can not upload empty 
report content to S3");
+                }
+                String bucketName = 
properties.getReport().getExport().getS3().getBucketName();
+                if (bucketName == null || StringUtils.isBlank(bucketName)) {

Review Comment:
   Please, replace all condition bucketName == null || 
StringUtils.isBlank(bucketName) to just 
    StringUtils.isBlank(bucketName) -
    
    if (StringUtils.isBlank(bucketName)) and then it will be ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to