mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-09 14:31:17 +00:00
fix issue with FHIRPath engine throwing exception for an invalid path
This commit is contained in:
parent
8a34a90cee
commit
4544c8762a
@ -6522,15 +6522,15 @@ public class FHIRPathEngine {
|
||||
}
|
||||
if (ed.hasContentReference() && path.startsWith(ed.getPath()+".")) {
|
||||
ElementDefinitionMatch m = getElementDefinitionById(sd, ed.getContentReference());
|
||||
List<ElementDefinitionMatch> res = getElementDefinition(sd, m.definition.getPath()+path.substring(ed.getPath().length()), allowTypedName, expr);
|
||||
if (res.size() == 0) {
|
||||
throw new Error("Unable to find "+ed.getContentReference());
|
||||
if (m == null) {
|
||||
throw new Error("Unable to find path "+path+" with a content reference of "+ed.getContentReference());
|
||||
} else {
|
||||
List<ElementDefinitionMatch> res = getElementDefinition(sd, m.definition.getPath()+path.substring(ed.getPath().length()), allowTypedName, expr);
|
||||
for (ElementDefinitionMatch item : res) {
|
||||
item.sourceDefinition = ed;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
return ml(null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user