BrightcoveOS/Java-MAPI-Wrapper — Issue #3: Playlists: ClassCastException when JSONObject$Null is returned in response
Author: thecodeag
Created: 2012-02-01 14:43:23+00:00
State: open

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