temi-ro commented on code in PR #2339:
URL: https://github.com/apache/fineract/pull/2339#discussion_r884129538
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/api/ImagesApiResource.java:
##########
@@ -165,8 +165,13 @@ public Response retrieveImage(@PathParam("entity") final
String entityName, @Pat
try {
byte[] resizedImageBytes = resizedImage.getByteSource().read();
- final String clientImageAsBase64Text = imageDataURISuffix +
Base64.getMimeEncoder().encodeToString(resizedImageBytes);
- return Response.ok(clientImageAsBase64Text,
MediaType.TEXT_PLAIN_TYPE).build();
+
+ if(resizedImageBytes != null){
+ final String clientImageAsBase64Text = imageDataURISuffix +
Base64.getMimeEncoder().encodeToString(resizedImageBytes);
+ return Response.ok(clientImageAsBase64Text,
MediaType.TEXT_PLAIN_TYPE).build();
+ }else{
+ return Response.noContent().build();
Review Comment:
Done!
--
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]