vorburger commented on code in PR #2339:
URL: https://github.com/apache/fineract/pull/2339#discussion_r884130008
##########
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){
Review Comment:
@galovics Hey! Thanks for jumping on this review - on a Saturday no less.
So, the context here is that @temi-ro is a student who I'm teaching how to
FLOSS and GitHub... we picked FINERACT-1224 as an example, and this is his very
first contribution. We haven't gotten to actually running Fineract, and
uploading images, and fully reproducing the issue. This would take more time
than we have together today. The question is if this PR as-is (once it passed
the build, of course) could be acceptable to you as a first step to at least
avoid the NPE and clearer diagnostic log, as a first step? Still better than
the NPE, IMHO. (I may follow-up with @temi-ro to further improve this case when
I show him how to actually run everything etc.)
--
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]