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:
Lloyd McKenzie 2021-05-19 19:04:11 -06:00
parent d17a8da923
commit 5d9b7f4d62
1 changed files with 2 additions and 0 deletions

View File

@ -885,6 +885,8 @@ private boolean elementIsOk(String name) throws FHIRFormatError {
// UInt16 w;
readChar();
String c = readUntil(";&'\"><");
if (c.isEmpty())
throw new FHIRFormatError("Invalid literal declaration following text: " + s);
if (c.equals("apos"))
s.append('\'');
else if (c.equals("quot"))