Java 在获取JSON数据时获取NullpointerException

Java 在获取JSON数据时获取NullpointerException,java,android,json,nullpointerexception,Java,Android,Json,Nullpointerexception,当我试图通过api请求获取json数据时。我会得到一个NullPointerException public CouchPotatoMovie(JSONObject json) throws JSONException { this.title = json.getString("title"); this.status = json.getString("status"); this.id = json.getString("_id"); this.info =

当我试图通过api请求获取json数据时。我会得到一个NullPointerException

public CouchPotatoMovie(JSONObject json) throws JSONException {
    this.title = json.getString("title");
    this.status = json.getString("status");
    this.id = json.getString("_id");
    this.info = new CouchPotatoMovieInfo(json.getJSONObject("info"));
    if(json.getJSONArray("releases").length() != 0)
    {
        JSONArray array = json.getJSONArray("releases");
        for(int i = 0; i < array.length(); i++)
        {
            releases.add(new Release(array.getJSONObject(i)));
        }
    }
}
我收到的JSON很抱歉,我不知道如何在其中设置中断:

{"status": "active", "info": {"rating": {"imdb": [6.4000000000000004, 29064]}, "actor_roles": {"Rebecca Ferguson": "Ergenia", "Rufus Sewell": "Autolycus", "John Hurt": "Cotys", "Irina Shayk": "Megara", "Tobias Santelmann": "Rhesus", "Ian McShane": "Amphiarus", "Reece Ritchie": "Iolaus", "Ingrid Bols\u00f8 Berdal": "Atalanta", "Aksel Hennie": "Tydeus", "Dwayne Johnson": "Hercules"}, "tmdb_id": 184315, "plot": "Fourteen hundred years ago, a tormented soul walked the earth that was neither man nor god. Hercules was the powerful son of the god king Zeus, for this he received nothing but suffering his entire life. After twelve arduous labors and the loss of his family, this dark, world-weary soul turned his back on the gods finding his only solace in bloody battle. Over the years he warmed to the company of six similar souls, their only bond being their love of fighting and presence of death. These men and woman never question where they go to fight or why or whom, just how much they will be paid. Now the King of Thrace has hired these mercenaries to train his men to become the greatest army of all time. It is time for this bunch of lost souls to finally have their eyes opened to how far they have fallen when they must train an army to become as ruthless and blood thirsty as their reputation has become.", "tagline": "", "release_date": {"dvd": 0, "expires": 1413562699, "theater": 1406239200, "bluray": false}, "original_title": "Hercules", "genres": ["Action", "Adventure"], "via_imdb": true, "mpaa": "PG-13", "images": {"disc_art": [], "poster": ["https://image.tmdb.org/t/p/w154/d3gL1VX7FwhJ5iNAax2tEcchfN0.jpg", "http://ia.media-imdb.com/images/M/MV5BMTQ4ODA5MTA4OF5BMl5BanBnXkFtZTgwNjMyODM5MTE@._V1_.jpg", "http://ia.media-imdb.com/images/M/MV5BMTQ4ODA5MTA4OF5BMl5BanBnXkFtZTgwNjMyODM5MTE@._V1_SX300.jpg"], "extra_thumbs": [], "poster_original": ["https://image.tmdb.org/t/p/original/d3gL1VX7FwhJ5iNAax2tEcchfN0.jpg"], "landscape": [], "actors": {"Rebecca Ferguson": "https://image.tmdb.org/t/p/w185/dbIS4S32rrIJyEysx7huT6ZAmjN.jpg", "Rufus Sewell": "https://image.tmdb.org/t/p/w185/f2PNMnztHluTOw8YfCJUZ2pKfbe.jpg", "John Hurt": "https://image.tmdb.org/t/p/w185/rpuH2YRLpxJjMxHq4T1QdOSVtlN.jpg", "Irina Shayk": "https://image.tmdb.org/t/p/w185/lZGbyk3dHkxWPo0kqxJLNo25APn.jpg", "Tobias Santelmann": "https://image.tmdb.org/t/p/w185/sCtnswOiS203HyXTzlDesvEI4mj.jpg", "Ian McShane": "https://image.tmdb.org/t/p/w185/pY9ud4BJwHekNiO4MMItPbgkdAy.jpg", "Reece Ritchie": "https://image.tmdb.org/t/p/w185/7zUVjsbIxPkmBNf7DYXH1kR1QVy.jpg", "Ingrid Bols\u00f8 Berdal": "https://image.tmdb.org/t/p/w185/raEPYKXAe6NP0m3WUyJDh7PQUR3.jpg", "Aksel Hennie": "https://image.tmdb.org/t/p/w185/fEmgeaFbhzOSBRqe2mO6sa1EaSp.jpg", "Dwayne Johnson": "https://image.tmdb.org/t/p/w185/n432vxKiMpgdCmOjq7UX6Gatisa.jpg"}, "backdrop_original": ["https://image.tmdb.org/t/p/original/5CdgKsD4Rg87XIXmQSSomod5VCH.jpg"], "clear_art": [], "logo": [], "banner": [], "backdrop": ["https://image.tmdb.org/t/p/w1280/5CdgKsD4Rg87XIXmQSSomod5VCH.jpg"], "extra_fanart": []}, "directors": ["Brett Ratner"], "titles": ["Hercules", "Hercules: The Thracian Wars", "Hercules - Il guerriero"], "imdb": "tt1267297", "year": 2014, "via_tmdb": true, "actors": ["Dwayne Johnson", "Ian McShane", "John Hurt", "Rufus Sewell"], "writers": ["Ryan Condal (screenplay)", "Evan Spiliotopoulos (screenplay)", "Steve Moore (Radical comic \"Hercules\")"], "runtime": 99, "type": "movie", "released": "2014-07-25"}, "_t": "media", "releases": [{"status": "ignored", "info": {"size": 0, "protocol": "nzb", "description": "Verenigde Staten<br>Actie / Avontuur<br>99 minuten<br><br>geregisseerd door Renny Harlin<br>met Kellan Lutz, Liam McIntyre en Richard Reid<br><br>Een jonge legerkapitein (Liam McIntyre) wordt een goede vriend van Hercules (Kellan Lutz), de zoon van de oppergod Zeus. Maar nadat een slechte koning hen misleidt, worden Hercules en de kapitein in slavernij verkocht en moeten ze zij aan zij vechten om hun vrijheid terug te verdienen.<br><br><br><br><br><br><br><br><br><br><br><br><br>Container: Mp4<br>Quality: 720p<br>Formaat: x264<br>Audio: Ac3 standaard <br>Language: English<br>Subtitles: Nederlands<br>Size: 756.86 MB<br><br>Geschikt voor alle soorten tv&amp;#39;s en tablets.<br><br>Deze eigen upload  heb ik encrypted geplaatst wegens notice and takedown.<br><br>Onder de downloadpijl zit een DUMMY NZB.<br><br>GEBRUIK ONDERSTAANDE LINK VOOR DE GOEDE NZB :<br><br>=====================<br><a href=\"http://bit.ly/1fAJf3V\">http://bit.ly/1fAJf3V<\/a><br>=====================<br><br>Veel kijkplezier.<br /><font color=\"#ca0000\">Door: karma (bElkFg)<\/font>", "url": "http://somename.nl/spotweb/api?t=get&id=zyRjtpRGKFIFzBbUwK91l%40spot.net&apikey=", "age": 170, "name_extra": "karma", "id": "zyRjtpRGKFIFzBbUwK91l@spot.net", "score": 11, "provider": "Newznab", "seed_time": "", "provider_extra": ", somename.nl", "detail_url": "http://somename.nl/spotweb/", "type": "movie", "seed_ratio": "", "name": "The Legend of Hercules (2014) 720P NL SUBS k-a-r-m-a verzoekje"}, "_id": "ab57eccca61940eb93fcc62777bbb9c6", "media_id": "77bea2dd23d649ca99b0bb5e3875222b", "_rev": "0003b524", "_t": "release", "is_3d": false, "last_edit": 1413210234, "identifier": "36abef91c978724a30e2739d2f25d108", "quality": "720p"}], "title": "Hercules", "_rev": "004cccea", "profile_id": "12e5762bf0fb4db3a85544c83e487537", "_id": "77bea2dd23d649ca99b0bb5e3875222b", "tags": ["recent"], "last_edit": 1413073002, "category_id": null, "type": "movie", "files": {"image_poster": ["/usr/local/couchpotato/var/cache/4d48972a70c175170d3b65b0521f9afa.jpg"]}, "identifiers": {"imdb": "tt1267297"}},

你初始化发布了吗?像新的ArrayList@Timmeeh93你能粘贴完整的痕迹吗?我需要看看控件是如何到达nl.somename.model.couchpato.availablecouchpato.java的:106@PedroOliveiraFACEPALM非常感谢你!我已经搜索这个问题一个多小时了。@Amal的问题已经解决了,就像Pedro Oliveira说的,我忘了初始化ArrayList了听到这个消息太好了@佩德罗的评论值得投票表决!
{"status": "active", "info": {"rating": {"imdb": [6.4000000000000004, 29064]}, "actor_roles": {"Rebecca Ferguson": "Ergenia", "Rufus Sewell": "Autolycus", "John Hurt": "Cotys", "Irina Shayk": "Megara", "Tobias Santelmann": "Rhesus", "Ian McShane": "Amphiarus", "Reece Ritchie": "Iolaus", "Ingrid Bols\u00f8 Berdal": "Atalanta", "Aksel Hennie": "Tydeus", "Dwayne Johnson": "Hercules"}, "tmdb_id": 184315, "plot": "Fourteen hundred years ago, a tormented soul walked the earth that was neither man nor god. Hercules was the powerful son of the god king Zeus, for this he received nothing but suffering his entire life. After twelve arduous labors and the loss of his family, this dark, world-weary soul turned his back on the gods finding his only solace in bloody battle. Over the years he warmed to the company of six similar souls, their only bond being their love of fighting and presence of death. These men and woman never question where they go to fight or why or whom, just how much they will be paid. Now the King of Thrace has hired these mercenaries to train his men to become the greatest army of all time. It is time for this bunch of lost souls to finally have their eyes opened to how far they have fallen when they must train an army to become as ruthless and blood thirsty as their reputation has become.", "tagline": "", "release_date": {"dvd": 0, "expires": 1413562699, "theater": 1406239200, "bluray": false}, "original_title": "Hercules", "genres": ["Action", "Adventure"], "via_imdb": true, "mpaa": "PG-13", "images": {"disc_art": [], "poster": ["https://image.tmdb.org/t/p/w154/d3gL1VX7FwhJ5iNAax2tEcchfN0.jpg", "http://ia.media-imdb.com/images/M/MV5BMTQ4ODA5MTA4OF5BMl5BanBnXkFtZTgwNjMyODM5MTE@._V1_.jpg", "http://ia.media-imdb.com/images/M/MV5BMTQ4ODA5MTA4OF5BMl5BanBnXkFtZTgwNjMyODM5MTE@._V1_SX300.jpg"], "extra_thumbs": [], "poster_original": ["https://image.tmdb.org/t/p/original/d3gL1VX7FwhJ5iNAax2tEcchfN0.jpg"], "landscape": [], "actors": {"Rebecca Ferguson": "https://image.tmdb.org/t/p/w185/dbIS4S32rrIJyEysx7huT6ZAmjN.jpg", "Rufus Sewell": "https://image.tmdb.org/t/p/w185/f2PNMnztHluTOw8YfCJUZ2pKfbe.jpg", "John Hurt": "https://image.tmdb.org/t/p/w185/rpuH2YRLpxJjMxHq4T1QdOSVtlN.jpg", "Irina Shayk": "https://image.tmdb.org/t/p/w185/lZGbyk3dHkxWPo0kqxJLNo25APn.jpg", "Tobias Santelmann": "https://image.tmdb.org/t/p/w185/sCtnswOiS203HyXTzlDesvEI4mj.jpg", "Ian McShane": "https://image.tmdb.org/t/p/w185/pY9ud4BJwHekNiO4MMItPbgkdAy.jpg", "Reece Ritchie": "https://image.tmdb.org/t/p/w185/7zUVjsbIxPkmBNf7DYXH1kR1QVy.jpg", "Ingrid Bols\u00f8 Berdal": "https://image.tmdb.org/t/p/w185/raEPYKXAe6NP0m3WUyJDh7PQUR3.jpg", "Aksel Hennie": "https://image.tmdb.org/t/p/w185/fEmgeaFbhzOSBRqe2mO6sa1EaSp.jpg", "Dwayne Johnson": "https://image.tmdb.org/t/p/w185/n432vxKiMpgdCmOjq7UX6Gatisa.jpg"}, "backdrop_original": ["https://image.tmdb.org/t/p/original/5CdgKsD4Rg87XIXmQSSomod5VCH.jpg"], "clear_art": [], "logo": [], "banner": [], "backdrop": ["https://image.tmdb.org/t/p/w1280/5CdgKsD4Rg87XIXmQSSomod5VCH.jpg"], "extra_fanart": []}, "directors": ["Brett Ratner"], "titles": ["Hercules", "Hercules: The Thracian Wars", "Hercules - Il guerriero"], "imdb": "tt1267297", "year": 2014, "via_tmdb": true, "actors": ["Dwayne Johnson", "Ian McShane", "John Hurt", "Rufus Sewell"], "writers": ["Ryan Condal (screenplay)", "Evan Spiliotopoulos (screenplay)", "Steve Moore (Radical comic \"Hercules\")"], "runtime": 99, "type": "movie", "released": "2014-07-25"}, "_t": "media", "releases": [{"status": "ignored", "info": {"size": 0, "protocol": "nzb", "description": "Verenigde Staten<br>Actie / Avontuur<br>99 minuten<br><br>geregisseerd door Renny Harlin<br>met Kellan Lutz, Liam McIntyre en Richard Reid<br><br>Een jonge legerkapitein (Liam McIntyre) wordt een goede vriend van Hercules (Kellan Lutz), de zoon van de oppergod Zeus. Maar nadat een slechte koning hen misleidt, worden Hercules en de kapitein in slavernij verkocht en moeten ze zij aan zij vechten om hun vrijheid terug te verdienen.<br><br><br><br><br><br><br><br><br><br><br><br><br>Container: Mp4<br>Quality: 720p<br>Formaat: x264<br>Audio: Ac3 standaard <br>Language: English<br>Subtitles: Nederlands<br>Size: 756.86 MB<br><br>Geschikt voor alle soorten tv&amp;#39;s en tablets.<br><br>Deze eigen upload  heb ik encrypted geplaatst wegens notice and takedown.<br><br>Onder de downloadpijl zit een DUMMY NZB.<br><br>GEBRUIK ONDERSTAANDE LINK VOOR DE GOEDE NZB :<br><br>=====================<br><a href=\"http://bit.ly/1fAJf3V\">http://bit.ly/1fAJf3V<\/a><br>=====================<br><br>Veel kijkplezier.<br /><font color=\"#ca0000\">Door: karma (bElkFg)<\/font>", "url": "http://somename.nl/spotweb/api?t=get&id=zyRjtpRGKFIFzBbUwK91l%40spot.net&apikey=", "age": 170, "name_extra": "karma", "id": "zyRjtpRGKFIFzBbUwK91l@spot.net", "score": 11, "provider": "Newznab", "seed_time": "", "provider_extra": ", somename.nl", "detail_url": "http://somename.nl/spotweb/", "type": "movie", "seed_ratio": "", "name": "The Legend of Hercules (2014) 720P NL SUBS k-a-r-m-a verzoekje"}, "_id": "ab57eccca61940eb93fcc62777bbb9c6", "media_id": "77bea2dd23d649ca99b0bb5e3875222b", "_rev": "0003b524", "_t": "release", "is_3d": false, "last_edit": 1413210234, "identifier": "36abef91c978724a30e2739d2f25d108", "quality": "720p"}], "title": "Hercules", "_rev": "004cccea", "profile_id": "12e5762bf0fb4db3a85544c83e487537", "_id": "77bea2dd23d649ca99b0bb5e3875222b", "tags": ["recent"], "last_edit": 1413073002, "category_id": null, "type": "movie", "files": {"image_poster": ["/usr/local/couchpotato/var/cache/4d48972a70c175170d3b65b0521f9afa.jpg"]}, "identifiers": {"imdb": "tt1267297"}},