From 1e046a0d0099e59346b83af0dcd579311b9e34c3 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 28 Oct 2022 21:59:08 +1100 Subject: [PATCH] fix for NPE rendering patient photo --- .../main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java index 9098f3e9d..49133f06e 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/PatientRenderer.java @@ -795,7 +795,7 @@ public class PatientRenderer extends ResourceRenderer { PropertyWrapper a = r.getChildByName("photo"); for (BaseWrapper v : a.getValues()) { Attachment att = (Attachment) v.getBase(); - if (att.getContentType().startsWith("image/") && + if (att.hasContentType() && att.getContentType().startsWith("image/") && att.getData() != null && (!context.isInlineGraphics() || (att.getData().length > 0 && att.getData().length < MAX_IMAGE_LENGTH))) { return true; }