diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/JSONUtil.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/JSONUtil.java index 346f319e6..301574ea7 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/JSONUtil.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/json/JSONUtil.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import com.google.gson.JsonObject; public class JSONUtil { @@ -73,7 +74,7 @@ public class JSONUtil { public static String str(JsonObject json, String name) { JsonElement e = json.get(name); - return e == null ? null : e.getAsString(); + return e == null || e instanceof JsonNull ? null : e.getAsString(); } public static String str(JsonObject json, String name1, String name2) {