Merge "Fixed a possible infinite loop in JsonReader#skipValue()"
This commit is contained in:
@@ -546,6 +546,9 @@ public final class JsonReader implements Closeable {
|
|||||||
public void skipValue() throws IOException {
|
public void skipValue() throws IOException {
|
||||||
skipping = true;
|
skipping = true;
|
||||||
try {
|
try {
|
||||||
|
if (!hasNext() || peek() == JsonToken.END_DOCUMENT) {
|
||||||
|
throw new IllegalStateException("No element left to skip");
|
||||||
|
}
|
||||||
int count = 0;
|
int count = 0;
|
||||||
do {
|
do {
|
||||||
JsonToken token = advance();
|
JsonToken token = advance();
|
||||||
|
|||||||
Reference in New Issue
Block a user