Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'getStatus' of undefined #62

Open
chromecast-sponsorblock opened this issue Oct 25, 2020 · 0 comments
Open

Cannot read property 'getStatus' of undefined #62

chromecast-sponsorblock opened this issue Oct 25, 2020 · 0 comments

Comments

@chromecast-sponsorblock
Copy link
Contributor

TypeError: Cannot read property 'getStatus' of undefined
    at [...]/chromecast-api/lib/device.js:179:19
    at Device._tryJoin ([...]/chromecast-api/lib/device.js:146:29)
    at Device.getStatus ([...]/chromecast-api/lib/device.js:174:10)

device.js.getStatus starts with calling this._tryJoin. tryJoin adds to the device the client and the player object. but if the device has a client and no player, it skips this. this means there is no player and this.player.getStatus fails.

The issue can be fixed by changing the guard close of _tryJoin from "if (this.client)" to "if (this.client && this.player)".

Have a nice day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant