Avoid NPEs for incorrect client logo URLs

pull/1611/head
Andrea Ceccanti 2017-02-24 14:55:01 +01:00
parent ec28327605
commit ebdce87f5f
1 changed files with 4 additions and 0 deletions

View File

@ -514,6 +514,10 @@ public class ClientAPI {
// get the image from cache
CachedImage image = clientLogoLoadingService.getLogo(client);
if (image == null){
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.parseMediaType(image.getContentType()));
headers.setContentLength(image.getLength());