jonbarrow / stream-box

Free, open source, movie and TV show streaming application
63 stars 20 forks source link

Error "Cannot read property 'map' of undefined" when selecting a show #7

Open hexaclue opened 5 years ago

hexaclue commented 5 years ago

Error Cannot read property 'map' of undefined in the console when selecting a show without a seasonDetails.genre_ids property, causing an app softlock (the loading animation cannot be dismissed). Stream Box version: c989568276a15a3c8c6b3d3ca9d4f66153cfb970

Full error:

Unhandled Rejection at: Promise Promise {
  <rejected> TypeError: Cannot read property 'map' of undefined
      at EventEmitter.<anonymous> (C:\[...]\stream-box\index.js:258:35)
      at processTicksAndRejections (internal/process/task_queues.js:89:5)
} reason: TypeError: Cannot read property 'map' of undefined
    at EventEmitter.<anonymous> (C:\[...]\stream-box\index.js:258:35)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
jonbarrow commented 5 years ago

I have never come across a series or movie without that property, can you provide the name of the media so I can check it out further?

hexaclue commented 5 years ago

Series I encountered this issue with is Disney's Amphibia.

An easy fix would be creating an empty array variable, then wrapping the map function in a try/catch block. Then, when sending the update, send the variable created earlier.