diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java index d90d652ba..b9fc4a258 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java @@ -256,7 +256,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { if (cs == null) { return null; } - ConceptDefinitionComponent cc = CodeSystemUtilities.getCode(cs, code); + ConceptDefinitionComponent cc = code == null ? null : CodeSystemUtilities.getCode(cs, code); return cc == null ? null : cc.getDisplay(); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java index 5482a2645..03d7fbdf8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/CodeSystemUtilities.java @@ -430,6 +430,9 @@ public class CodeSystemUtilities { } public static ConceptDefinitionComponent getCode(CodeSystem cs, String code) { + if (code == null) { + return null; + } for (ConceptDefinitionComponent cc : cs.getConcept()) { ConceptDefinitionComponent cd = getCode(cc, code); if (cd != null) {