JMPerez / spotify-web-api-js

A client-side JS wrapper for the Spotify Web API
https://jmperezperez.com/spotify-web-api-js/
MIT License
1.87k stars 260 forks source link

Verify options exist before checking a value for device_id #122

Closed Digized closed 5 years ago

Digized commented 5 years ago

Currently we have to do something like seek(0, {}) which doesn't feel right. This should verify that options exist before we try to look at the values of options

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 98.396% when pulling a09299fc96920d817821efcb113c5b13374d6717 on Digized:patch-1 into 932e72d7fb50229de741adb8d959fcd0d4f4925f on JMPerez:master.

JMPerez commented 5 years ago

@Digized you shouldn't need to do seek(0, {}) since options gets initialized to {} if not provided, according to the code. The fix, on https://github.com/JMPerez/spotify-web-api-js/pull/116, should have been included in the latest release of the library.