Skip to content

Commit

Permalink
integration/spotify: Fix getMe() when display_name is not set in spotify
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Apr 5, 2018
1 parent 0e76f2d commit 591f34e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/integrations/spotify.js
Expand Up @@ -45,8 +45,8 @@ class Spotify {
const enabled = await this.status({ log: false })
if (enabled && !_.isNil(this.client)) {
let data = await this.client.getMe()
debug('spotify:getMe')('Authorized user: ' + data.body.display_name)
return data.body.display_name
debug('spotify:getMe')('Authorized user: %j', data.body)
return data.body.display_name ? data.body.display_name : data.body.id
} else return null
} catch (e) {
if (e.message !== 'Unauthorized') {
Expand Down

0 comments on commit 591f34e

Please sign in to comment.