Fix bug handling null objects in JSON (R5)
This commit is contained in:
parent
1cdcfb3396
commit
cf4a970e47
File diff suppressed because it is too large
Load Diff
|
@ -176,6 +176,17 @@ public abstract class JsonParserBase extends ParserBase implements IParser {
|
|||
return (JsonArray) j;
|
||||
}
|
||||
|
||||
protected JsonObject getJsonObjectFromArray(JsonArray array, int i) throws IOException {
|
||||
JsonElement e = array.get(i);
|
||||
if (e.isJsonObject()) {
|
||||
return (JsonObject) e;
|
||||
}
|
||||
if (e.isJsonNull()) {
|
||||
return new JsonObject();
|
||||
}
|
||||
throw new IOException("Array item "+i+" is a "+e.getClass()+" looking for an Object");
|
||||
}
|
||||
|
||||
/**
|
||||
* Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
* @throws IOException
|
||||
|
|
Loading…
Reference in New Issue