Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,31 @@ private RichObject readObject(String tag, JsonReader in) throws IOException {
RichObject richObject = new RichObject();
richObject.setTag(tag);
while (in.hasNext()) {
String name = in.nextName();

String name;
try {
name = in.nextName();
} catch (IllegalStateException e) {
name = "";
}

switch (name) {
case "type":
richObject.setType(in.nextString());
richObject.setType(getNextString(in));
break;
case "id":
richObject.setId(in.nextString());
richObject.setId(getNextString(in));
break;
case "name":
richObject.setName(in.nextString());
richObject.setName(getNextString(in));
break;
case "path":
richObject.setPath(in.nextString());
richObject.setPath(getNextString(in));
break;
case "link":
richObject.setLink(in.nextString());
richObject.setLink(getNextString(in));
break;
case "server":
richObject.setLink(in.nextString());
richObject.setLink(getNextString(in));
break;
default:
in.skipValue(); // ignore value
Expand All @@ -124,5 +129,13 @@ private RichObject readObject(String tag, JsonReader in) throws IOException {
in.endObject();
return richObject;
}

private String getNextString(JsonReader in) {
try {
return in.nextString();
} catch (IllegalStateException | IOException e) {
return "";
}
}
}