From 076ee562e3647117e9d1374e4a9e88204ac54b64 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Thu, 6 Feb 2020 11:16:17 -0500 Subject: [PATCH] Avoid trying to fetch SD by null URL (test case added) --- .../java/org/hl7/fhir/r5/validation/InstanceValidator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java index 2e831205c..5accd1aef 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java @@ -1720,7 +1720,11 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat ok = true; break; } - sd = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); + if (sd.getBaseDefinition() != null) { + sd = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); + } else { + sd = null; + } } } }