fix null pointer with getting challenge with null image
LocationBasedServices/sumoc-backend/pipeline/pr-main Build queued...
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good

This commit is contained in:
Elias Harb
2026-02-06 01:50:19 +01:00
parent f961b3c2b3
commit 6f9f7c1ba0
@@ -15,7 +15,8 @@ public interface ChallengeMapper {
dto.setDescription(challenge.getDescription());
dto.setCriteria(challenge.getCriteria());
dto.setReward(challenge.getReward());
dto.setBase64image(ImageBase64Util.encode(challenge.getImage().getImageData()));
dto.setBase64image(challenge.getImage() != null && challenge.getImage().getImageData() != null ?
ImageBase64Util.encode(challenge.getImage().getImageData()) : null);
return dto;
}