diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java index 4446d30..d396880 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.Locale; import java.util.Properties; import java.util.Set; +import java.util.Map; import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.defaultString; @@ -138,7 +139,10 @@ public class HapiProperties { if (overrideProps != null) { properties.putAll(overrideProps); } - properties.putAll(System.getenv()); + properties.putAll(System.getenv().entrySet() + .stream() + .filter(e -> e.getValue() != null && properties.containsKey(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))); return properties; }