mirror of
https://gitlab.com/RemixDev/deemix-gui.git
synced 2025-01-29 17:58:28 +00:00
Fix crash with wrong spotify username
This commit is contained in:
parent
f279ed43b5
commit
516eb2557f
|
@ -10,7 +10,13 @@ const handler: ApiHandler['handler'] = async (req, res) => {
|
|||
const sp = deemix.plugins.spotify.sp
|
||||
const username = req.query.spotifyUser
|
||||
data = []
|
||||
let playlists = await sp.getUserPlaylists(username)
|
||||
let playlists
|
||||
try {
|
||||
playlists = await sp.getUserPlaylists(username)
|
||||
} catch (e) {
|
||||
res.send({ error: 'wrongSpotifyUsername', username })
|
||||
return
|
||||
}
|
||||
playlists = playlists.body
|
||||
let playlistList = playlists.items
|
||||
while (playlists.next) {
|
||||
|
|
Loading…
Reference in a new issue