fix NPEs
This commit is contained in:
parent
f27d5b3adf
commit
ade21ddb1f
|
@ -1375,7 +1375,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNoTerminologyServer() {
|
public boolean isNoTerminologyServer() {
|
||||||
return noTerminologyServer;
|
return noTerminologyServer || txClient == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNoTerminologyServer(boolean noTerminologyServer) {
|
public void setNoTerminologyServer(boolean noTerminologyServer) {
|
||||||
|
|
|
@ -427,6 +427,8 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
|
||||||
return null;
|
return null;
|
||||||
if (ext.size() > 1)
|
if (ext.size() > 1)
|
||||||
throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'");
|
throw new FHIRException("Multiple matching extensions found for extension '"+theUrl+"'");
|
||||||
|
if (!ext.get(0).hasValue())
|
||||||
|
return null;
|
||||||
if (!ext.get(0).getValue().isPrimitive())
|
if (!ext.get(0).getValue().isPrimitive())
|
||||||
throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string");
|
throw new FHIRException("Extension '"+theUrl+"' could not be converted to a string");
|
||||||
return ext.get(0).getValue().primitiveValue();
|
return ext.get(0).getValue().primitiveValue();
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.hl7.fhir.r5.elementmodel.Element;
|
||||||
import org.hl7.fhir.r5.elementmodel.Manager;
|
import org.hl7.fhir.r5.elementmodel.Manager;
|
||||||
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
|
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
|
||||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||||
|
import org.hl7.fhir.r5.model.Base;
|
||||||
import org.hl7.fhir.r5.model.Coding;
|
import org.hl7.fhir.r5.model.Coding;
|
||||||
import org.hl7.fhir.r5.model.ElementDefinition;
|
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||||
import org.hl7.fhir.r5.model.ExpressionNode;
|
import org.hl7.fhir.r5.model.ExpressionNode;
|
||||||
|
@ -165,7 +166,10 @@ public class StructureDefinitionValidator extends BaseValidator {
|
||||||
}
|
}
|
||||||
String tc = type.getChildValue("code");
|
String tc = type.getChildValue("code");
|
||||||
if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
|
if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
|
||||||
tc = type.getExtensionValue(ToolingExtensions.EXT_FHIR_TYPE).primitiveValue();
|
Base tcv = type.getExtensionValue(ToolingExtensions.EXT_FHIR_TYPE);
|
||||||
|
if (tcv != null) {
|
||||||
|
tc = tcv.primitiveValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (Utilities.noString(tc) && type.hasChild("code")) {
|
if (Utilities.noString(tc) && type.hasChild("code")) {
|
||||||
if (VersionUtilities.isR4Plus(context.getVersion())) {
|
if (VersionUtilities.isR4Plus(context.getVersion())) {
|
||||||
|
|
Loading…
Reference in New Issue