theDavidBarton/trending-movies-react-app

TypeError: Cannot read property 'match' of undefined

theDavidBarton opened this issue · 1 comments

https://trending-movies-react-app.herokuapp.com/en/movie/684088
https://www.themoviedb.org/movie/684088-the-stand?language=en-US

example for the non-existent movie details:

{"status_code":34,"status_message":"The resource you requested could not be found."}

vs an existing response:

{"adult":false,"backdrop_path":null,"belongs_to_collection":null,"budget":0,"genres":[{"id":18,"name":"Drama"},{"id":36,"name":"History"}],"homepage":"","id":9045,"imdb_id":"tt0280653","original_language":"fr","original_title":"Amen.","overview":"Kurt Gerstein—a member of the Institute for Hygiene of the Waffen-SS—is horrified by what he sees in the death camps. he is then shocked to learn that the process he used to purify water for his troops by using Zyklon-B, is now used to kill people in gas chambers.","popularity":8.394,"poster_path":"/wI7tl0cRQquWDw7gaMe6LNj34gh.jpg","production_companies":[{"id":13837,"logo_path":null,"name":"K.G Productions","origin_country":""},{"id":22182,"logo_path":null,"name":"KC Medien","origin_country":""},{"id":22370,"logo_path":null,"name":"Katharina","origin_country":""},{"id":82,"logo_path":null,"name":"Renn Productions","origin_country":""},{"id":104,"logo_path":"/9aotxauvc9685tq9pTcRJszuT06.png","name":"Canal+","origin_country":"FR"},{"id":356,"logo_path":"/9tW5wZEGotn1Ei5pErA88m47XiD.png","name":"TF1 Films Production","origin_country":"FR"}],"production_countries":[{"iso_3166_1":"FR","name":"France"},{"iso_3166_1":"DE","name":"Germany"},{"iso_3166_1":"RO","name":"Romania"}],"release_date":"2002-02-13","revenue":0,"runtime":132,"spoken_languages":[{"iso_639_1":"de","name":"Deutsch"},{"iso_639_1":"fr","name":"Français"},{"iso_639_1":"en","name":"English"},{"iso_639_1":"it","name":"Italiano"}],"status":"Released","tagline":"Two Men   Two Worlds   One Cause","title":"Amen.","video":false,"vote_average":7,"vote_count":183,"videos":{"results":[{"id":"533ec664c3a3685448001500","iso_639_1":"en","iso_3166_1":"US","key":"IaG672NAfj4","name":"2002 AMEN TRAILER","site":"YouTube","size":360,"type":"Trailer"}]},"credits":{"cast":[{"cast_id":1,"character":"Kurt Gerstein","credit_id":"52fe44d6c3a36847f80acd7b","gender":2,"id":8198,"name":"Ulrich Tukur","order":0,"profile_path":null},{"cast_id":2,"character":"Riccardo Fontana","credit_id":"52fe44d6c3a36847f80acd7f","gender":2,"id":2406,"name":"Mathieu Kassovitz","order":1,"profile_path":"/3FRBEdKKlxhvPWPt0jzgmSjeHwn.jpg"},{"cast_id":3,"character":"SS-Arzt","credit_id":"52fe44d6c3a36847f80acd83","gender":2,"id":8196,"name":"Ulrich Mühe","order":2,"profile_path":"/8jjYOQgLwtWnB2stXEXp3IMNRqJ.jpg"},{"cast_id":4,"character":"Kardinal","credit_id":"52fe44d6c3a36847f80acd87","gender":2,"id":19062,"name":"Michel Duchaussoy","order":3,"profile_path":null},{"cast_id":5,"character":"Papst Pius XII.","credit_id":"52fe44d6c3a36847f80acd8b","gender":2,"id":15320,"name":"Marcel Iureș","order":4,"profile_path":"/7WOHhqlsE6Ae7sSjOqJiyG8CLU0.jpg"},{"cast_id":6,"character":"Graf Fontana","credit_id":"52fe44d6c3a36847f80acd8f","gender":2,"id":15321,"name":"Ion Caramitru","order":5,"profile_path":null},{"cast_id":7,"character":"Gersteins Vater","credit_id":"52fe44d6c3a36847f80acd93","gender":2,"id":6698,"name":"Friedrich von Thun","order":6,"profile_path":"/cXA8KnZ12DWIyE5CY4ZeFHBs4WQ.jpg"},{"cast_id":8,"character":"Gersteins Frau","credit_id":"52fe44d6c3a36847f80acd97","gender":1,"id":38299,"name":"Antje Schmidt","order":7,"profile_path":null},{"cast_id":9,"character":"Pastor Dibelius","credit_id":"52fe44d6c3a36847f80acd9b","gender":2,"id":2344,"name":"Günther Maria Halmer","order":8,"profile_path":"/sSZefFA66Dj4EtHmbkoLwNQQpOf.jpg"},{"cast_id":10,"character":"Grawitz","credit_id":"52fe44d6c3a36847f80acd9f","gender":2,"id":169,"name":"Hanns Zischler","order":9,"profile_path":null},{"cast_id":11,"character":"Höss","credit_id":"52fe44d6c3a36847f80acda3","gender":2,"id":8197,"name":"Sebastian Koch","order":10,"profile_path":"/8SwezG5hrK0S8Bv9xNQ2vfYsrgM.jpg"},{"cast_id":12,"character":"Mrs. Hinze","credit_id":"52fe44d6c3a36847f80acda7","gender":1,"id":16782,"name":"Monica Bleibtreu","order":11,"profile_path":"/urIoLr8trRaycTxJ0MJwZgE6bB0.jpg"},{"cast_id":13,"character":"Baron von Otter","credit_id":"52fe44d6c3a36847f80acdab","gender":2,"id":5646,"name":"Justus von Dohnányi","order":12,"profile_path":"/fuYtxNjlzzS0WPS4mm6XnovrEjS.jpg"},{"cast_id":33,"character":"Pastor Wehr","credit_id":"5662ea2cc3a3682bef0043cf","gender":0,"id":36177,"name":"Pierre Franckh","order":13,"profile_path":null},{"cast_id":34,"character":"Von Weizsäcker","credit_id":"5662ea5bc3a3682bde003956","gender":2,"id":11951,"name":"August Zirner","order":14,"profile_path":null},{"cast_id":35,"character":"Alexandra Baltz","credit_id":"5662ea759251412d7b003c0c","gender":1,"id":19123,"name":"Susanne Lothar","order":15,"profile_path":null},{"cast_id":36,"character":"Monsignore Hudal","credit_id":"5662ea96c3a3682c01003cbc","gender":2,"id":8802,"name":"Michael Mendl","order":16,"profile_path":null},{"cast_id":37,"character":"Helga","credit_id":"5662eaa29251412acd003b79","gender":1,"id":38720,"name":"Nina Proll","order":17,"profile_path":"/1ChWtd0dvOQsAfsqSXwwlBLkXUy.jpg"},{"cast_id":38,"character":"Schachspieler","credit_id":"5662eab19251412ad3003c17","gender":2,"id":8206,"name":"Hinnerk Schönemann","order":18,"profile_path":"/2EIUYZ4nq6C2JPQolVwJLlSzudi.jpg"},{"cast_id":39,"character":"Ambassador Taylor","credit_id":"5cc51f960e0a26168debeda6","gender":2,"id":120833,"name":"Richard Durden","order":19,"profile_path":null},{"cast_id":40,"character":"Tittman","credit_id":"5cc51fa40e0a263447ebf1ed","gender":2,"id":58475,"name":"Angus MacInnes","order":20,"profile_path":null}],"crew":[{"credit_id":"52fe44d6c3a36847f80acdb7","department":"Writing","gender":2,"id":27436,"job":"Screenplay","name":"Costa-Gavras","profile_path":"/bl1btgToPWi51bakxv2Gze8N4p3.jpg"},{"credit_id":"52fe44d6c3a36847f80acdb1","department":"Directing","gender":2,"id":27436,"job":"Director","name":"Costa-Gavras","profile_path":"/bl1btgToPWi51bakxv2Gze8N4p3.jpg"},{"credit_id":"555461abc3a36820860021c3","department":"Production","gender":1,"id":474,"job":"Casting","name":"Jina Jay","profile_path":null},{"credit_id":"52fe44d6c3a36847f80acddb","department":"Editing","gender":2,"id":19379,"job":"Editor","name":"Yannick Kergoat","profile_path":null},{"credit_id":"52fe44d6c3a36847f80acdcf","department":"Sound","gender":2,"id":20682,"job":"Original Music Composer","name":"Armand Amar","profile_path":"/kLYTExohdrXXcscsEGNiAnqI2fI.jpg"},{"credit_id":"52fe44d6c3a36847f80acdd5","department":"Camera","gender":2,"id":20683,"job":"Director of Photography","name":"Patrick Blossier","profile_path":null},{"credit_id":"52fe44d6c3a36847f80acde1","department":"Writing","gender":2,"id":23552,"job":"Theatre Play","name":"Rolf Hochhuth","profile_path":null},{"credit_id":"555461dfc3a368207d001d8c","department":"Art","gender":0,"id":35126,"job":"Art Direction","name":"Emita Frigato","profile_path":null},{"credit_id":"555462299251416de5001dd0","department":"Costume & Make-Up","gender":0,"id":39192,"job":"Costume Design","name":"Edith Vesperini","profile_path":null},{"credit_id":"5554618d9251416ddf001db4","department":"Production","gender":1,"id":49103,"job":"Casting","name":"Sabine Schroth","profile_path":null},{"credit_id":"555461769251416ddb001d9a","department":"Production","gender":0,"id":52983,"job":"Casting","name":"Florin Kevorkian","profile_path":null},{"credit_id":"52fe44d6c3a36847f80acdbd","department":"Writing","gender":0,"id":56837,"job":"Screenplay","name":"Jean-Claude Grumberg","profile_path":null},{"credit_id":"52fe44d6c3a36847f80acdc3","department":"Production","gender":2,"id":56839,"job":"Producer","name":"Andrei Boncea","profile_path":"/vdaB2hBoQnpTBYa4rKdU1NjT1wE.jpg"},{"credit_id":"52fe44d6c3a36847f80acdc9","department":"Production","gender":0,"id":56840,"job":"Producer","name":"Michèle Ray-Gavras","profile_path":null},{"credit_id":"5554626ec3a368208a001f19","department":"Directing","gender":1,"id":1346957,"job":"Script Supervisor","name":"Andra Barbuica","profile_path":null},{"credit_id":"555461f3925141393100043a","department":"Art","gender":0,"id":1426563,"job":"Art Direction","name":"Maria Miu","profile_path":null},{"credit_id":"555461ccc3a368208a001efe","department":"Art","gender":2,"id":1466989,"job":"Production Design","name":"Ari Hantke","profile_path":null},{"credit_id":"5554620b9251416ddf001dce","department":"Art","gender":0,"id":1466990,"job":"Set Decoration","name":"Carmen Pasula","profile_path":null}]}}

fixed by #85