fix for NPE rendering patient photo

This commit is contained in:
Grahame Grieve 2022-10-28 21:59:08 +11:00
parent 27febc03ef
commit 1e046a0d00
1 changed files with 1 additions and 1 deletions

View File

@ -795,7 +795,7 @@ public class PatientRenderer extends ResourceRenderer {
PropertyWrapper a = r.getChildByName("photo"); PropertyWrapper a = r.getChildByName("photo");
for (BaseWrapper v : a.getValues()) { for (BaseWrapper v : a.getValues()) {
Attachment att = (Attachment) v.getBase(); 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))) { att.getData() != null && (!context.isInlineGraphics() || (att.getData().length > 0 && att.getData().length < MAX_IMAGE_LENGTH))) {
return true; return true;
} }