This repository was archived by the owner on Jun 11, 2019. It is now read-only.
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Playlists: ClassCastException when JSONObject$Null is returned in response #3
Open

Description
This error occurs when FindPlaylistsByIds(..) is called with an id that no longer matches to any playlist (the Playlist has been deleted at Brightcove - or never existed).
In this case, JSONObject$Null is being returned within the result array and gets cast to JSONObject, which raises a ClassCastException:
public class Playlists extends ArrayList {
...
public Playlists(JSONObject jsonObj) throws JSONException {
JSONArray jsonItems = jsonObj.getJSONArray("items");
for(int itemIdx=0;itemIdx<jsonItems.length();itemIdx++){
JSONObject jsonItem = (JSONObject)jsonItems.get(itemIdx);
Playlist playlist = new Playlist(jsonItem);
add(playlist);
}
...
}
...
}
Metadata
Metadata
Assignees
Labels
No labels