diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java index 3d4f7796a..a07b631a5 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java @@ -498,7 +498,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple // nup, don't have it locally (or it's expired) FilesystemPackageCacheManager.InputStreamWithSrc source; - if ("current".equals(version) || version.startsWith("current$")) { + if ("current".equals(version) || (version!= null && version.startsWith("current$"))) { // special case - fetch from ci-build server source = loadFromCIBuild(id, version.startsWith("current$") ? version.substring(8) : null); } else { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java index e3067e253..56dff70ff 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java @@ -256,10 +256,10 @@ public class ValidationService { public void compile(CliContext cliContext, ValidationEngine validator) throws Exception { if (cliContext.getSources().size() > 0) throw new Exception("Cannot specify sources when compling transform (found " + cliContext.getSources() + ")"); -// if (cliContext.getTxServer() == null) -// throw new Exception("Must provide a terminology server when compiling a transform"); if (cliContext.getMap() == null) throw new Exception("Must provide a map when compiling a transform"); + if (cliContext.getOutput() == null) + throw new Exception("Must provide an output name when compiling a transform"); try { List structures = validator.getContext().allStructures(); for (StructureDefinition sd : structures) { @@ -272,12 +272,11 @@ public class ValidationService { } } validator.setMapLog(cliContext.getMapLog()); - cliContext.getMap(); StructureMap map = validator.compile(cliContext.getMap()); + if (map == null) + throw new Exception("Unable to locate map " + cliContext.getMap()); + validator.handleOutput(map, cliContext.getOutput(), validator.getVersion()); System.out.println(" ...success"); - if (cliContext.getOutput() != null) { - validator.handleOutput(map, cliContext.getOutput(), validator.getVersion()); - } } catch (Exception e) { System.out.println(" ...Failure: " + e.getMessage()); e.printStackTrace();