guilhermesad / rspotify

A ruby wrapper for the Spotify Web API
MIT License
717 stars 290 forks source link

Fix user.player #219

Closed carlosefonseca closed 4 years ago

carlosefonseca commented 4 years ago

When doing user.player, I'm getting the error NoMethodError: undefined methodpresent?' for #`. Since no other method seems to be using this check before parsing the response, I'm suggesting its removal.

carlosefonseca commented 4 years ago

I've updated the PR since I found that if Spotify can return an empty response (nothing is playing) and it would return nil instead of a Player object, not allowing the play methods to be called.

guilhermesad commented 4 years ago

👍