fix(serialize-xml): prevent overzealous null
This commit is contained in:
parent
45eee07a29
commit
8992e42393
@ -190,6 +190,20 @@ public class NativeXmlReader implements Closeable {
|
||||
return p != PEEKED_EOF && p != PEEKED_END_TAG && p != PEEKED_END_TAG_CONCISE;
|
||||
}
|
||||
|
||||
public boolean isConciseEndTag() throws IOException {
|
||||
int p = peeked;
|
||||
if (p == PEEKED_NONE) {
|
||||
p = doPeek();
|
||||
}
|
||||
if (p == PEEKED_END_TAG_CONCISE) {
|
||||
return true;
|
||||
} else if (p == PEEKED_END_TAG) {
|
||||
return false;
|
||||
} else {
|
||||
throw unexpectedTokenError("END_TAG");
|
||||
}
|
||||
}
|
||||
|
||||
public XmlToken peek() throws IOException {
|
||||
int p = peeked;
|
||||
if (p == PEEKED_NONE) {
|
||||
|
@ -263,6 +263,7 @@ public class XmlReader extends SerializeReader<IOException, XmlReader> implement
|
||||
yield doPeek();
|
||||
}
|
||||
case WrapperScope.OBJECT_VALUE_WRAPPER -> {
|
||||
if (!reader.isConciseEndTag()) throw syntaxError("Unexpected end tag");
|
||||
stackSize--;
|
||||
reader.endTag();
|
||||
yield PEEKED_NULL_VIRTUAL;
|
||||
|
Loading…
Reference in New Issue
Block a user