Skip to content

Commit d8badc0

Browse files
committed
WebLinks cause an exception in getChildrenRange()
WebLinks should be ignored for now until they're fully supported in the API.
1 parent a8410ee commit d8badc0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/com/box/sdk/BoxFolder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ public PartialCollection<BoxItem.Info> getChildrenRange(long offset, long limit,
396396
JsonArray jsonArray = responseJSON.get("entries").asArray();
397397
for (JsonValue value : jsonArray) {
398398
JsonObject jsonObject = value.asObject();
399-
children.add(BoxItem.parseJSONObject(this.getAPI(), jsonObject));
399+
BoxItem.Info parsedItemInfo = BoxItem.parseJSONObject(this.getAPI(), jsonObject);
400+
if (parsedItemInfo != null) {
401+
children.add(parsedItemInfo);
402+
}
400403
}
401404
return children;
402405
}

src/main/java/com/box/sdk/BoxItem.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ static BoxItem.Info parseJSONObject(BoxAPIConnection api, JsonObject jsonObject)
3535
String type = jsonObject.get("type").asString();
3636
String id = jsonObject.get("id").asString();
3737

38-
BoxItem.Info parsedItemInfo;
38+
BoxItem.Info parsedItemInfo = null;
3939
if (type.equals("folder")) {
4040
BoxFolder folder = new BoxFolder(api, id);
4141
parsedItemInfo = folder.new Info(jsonObject);
4242
} else if (type.equals("file")) {
4343
BoxFile file = new BoxFile(api, id);
4444
parsedItemInfo = file.new Info(jsonObject);
45-
} else {
46-
assert false : "Unsupported item type: " + type;
47-
throw new BoxAPIException("Unsupported item type: " + type);
4845
}
4946

5047
return parsedItemInfo;

0 commit comments

Comments
 (0)