mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 06:14:45 +00:00
If there's an ampersand that doesn't actually have a closing semi-colon, the process eventually runs out of characters and then fails doing a charAt(0). Catch this issue and throw a useful exception.
This commit is contained in:
parent
d17a8da923
commit
5d9b7f4d62
@ -885,6 +885,8 @@ private boolean elementIsOk(String name) throws FHIRFormatError {
|
|||||||
// UInt16 w;
|
// UInt16 w;
|
||||||
readChar();
|
readChar();
|
||||||
String c = readUntil(";&'\"><");
|
String c = readUntil(";&'\"><");
|
||||||
|
if (c.isEmpty())
|
||||||
|
throw new FHIRFormatError("Invalid literal declaration following text: " + s);
|
||||||
if (c.equals("apos"))
|
if (c.equals("apos"))
|
||||||
s.append('\'');
|
s.append('\'');
|
||||||
else if (c.equals("quot"))
|
else if (c.equals("quot"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user