seydx / homebridge-bravia-tvos

Homebridge plugin for Sony Bravia Android TVs
MIT License
345 stars 32 forks source link

check speaker result before usage #186

Closed stefanlange closed 2 years ago

stefanlange commented 2 years ago

This PR fixes the following TypeError by checking for response.result[0] before using it:

TypeError: response.result[0].find is not a function
    at Handler.getSpeakerState (/usr/lib/node_modules/homebridge-bravia-tvos/src/accessories/accessory.handler.js:75:50)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Handler.poll (/usr/lib/node_modules/homebridge-bravia-tvos/src/accessories/accessory.handler.js:562:9)