diff --git a/lib/rspotify/user.rb b/lib/rspotify/user.rb index a5f9bfa3..e625d910 100644 --- a/lib/rspotify/user.rb +++ b/lib/rspotify/user.rb @@ -118,6 +118,7 @@ def create_playlist!(name, public: true) def currently_playing url = "me/player/currently-playing" response = RSpotify.resolve_auth_request(@id, url) + return nil unless response && response['item'] return response if RSpotify.raw_response Track.new response["item"] end