From ee3024c1b76f732f4faa2e946c38593f2ba7ef47 Mon Sep 17 00:00:00 2001 From: dotasek Date: Thu, 22 Aug 2024 13:36:54 -0400 Subject: [PATCH] WIP cherry-pick fix for NPE in IGLoader --- .../main/java/org/hl7/fhir/validation/IgLoader.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java index e0a1a9edc..9f64cdc62 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/IgLoader.java @@ -497,10 +497,12 @@ public class IgLoader implements IValidationEngineLoader { private Map fetchByPackage(String src, boolean loadInContext) throws FHIRException, IOException { NpmPackage pi; - InputStream stream = directProvider.fetchByPackage(src); - if (stream != null) { - pi = NpmPackage.fromPackage(stream); - return loadPackage(pi, loadInContext); + if (directProvider != null) { + InputStream stream = directProvider.fetchByPackage(src); + if (stream != null) { + pi = NpmPackage.fromPackage(stream); + return loadPackage(pi, loadInContext); + } } String id = src; String version = null;