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

Issue when closing spotify, would love to recreate this. Finna rewrite this so much better. #38

Open
dustinrouillard opened this issue Dec 4, 2017 · 4 comments

Comments

@dustinrouillard
Copy link

dustinrouillard commented Dec 4, 2017

When closing spotify this happens, javascript doesn't seem to be your strong suit. But bugs happen.

C:\Users\Tetrabyte\Documents\spoticord\app.js:59
    if (!res.track.track_resource || !res.track.artist_resource) return;
                  ^

TypeError: Cannot read property 'track_resource' of undefined
    at C:\Users\Tetrabyte\Documents\spoticord\app.js:59:19
    at Request._callback (C:\Users\Tetrabyte\Documents\spoticord\spotify.js:59:16)
    at Request.self.callback (C:\Users\Tetrabyte\Documents\spoticord\node_modules\request\request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (C:\Users\Tetrabyte\Documents\spoticord\node_modules\request\request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (C:\Users\Tetrabyte\Documents\spoticord\node_modules\request\request.js:1085:12)
    at Object.onceWrapper (events.js:314:30)
@tilda
Copy link

tilda commented Dec 5, 2017

Well this is obvious. Since you just closed Spotify, you obviously can't retrieve the track so the object is just undefined

@dustinrouillard
Copy link
Author

Okay but listen, yes I closed spotify but this error can be caught... Should be caught, you should never have code with errors in it...

@dustinrouillard
Copy link
Author

#39

@visualcookie
Copy link

@thetetrabyte is actually right. Never have code run issues. Just check for "undefined" and emit the process. It's very much needed, especially when you run Spoticord with a process manager like pm2.

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

3 participants