minor fix

This commit is contained in:
anhefti 2019-10-09 10:02:47 +02:00
parent 1c1e427efd
commit 7bcf4080f4

View file

@ -43,11 +43,15 @@ public class InfoController {
method = RequestMethod.GET, method = RequestMethod.GET,
produces = MediaType.IMAGE_PNG_VALUE + ";base64") produces = MediaType.IMAGE_PNG_VALUE + ";base64")
public String logo(@PathVariable final String urlSuffix) { public String logo(@PathVariable final String urlSuffix) {
if (urlSuffix == null) {
return null;
}
return this.institutionDAO return this.institutionDAO
.all(null, true) .all(null, true)
.getOrThrow() .getOrThrow()
.stream() .stream()
.filter(inst -> urlSuffix.endsWith(inst.urlSuffix)) .filter(inst -> inst.urlSuffix != null && urlSuffix.endsWith(inst.urlSuffix))
.findFirst() .findFirst()
.map(inst -> inst.logoImage) .map(inst -> inst.logoImage)
.orElse(null); .orElse(null);