From 7412a499edb2d83ff184daf7d8ba33ff486a058d Mon Sep 17 00:00:00 2001 From: skidoodle <53189968+skidoodle@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:31:14 +0200 Subject: [PATCH] Update spotify.ts Signed-off-by: skidoodle <53189968+skidoodle@users.noreply.github.com> --- pages/api/spotify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/spotify.ts b/pages/api/spotify.ts index c6b91db..916e81e 100644 --- a/pages/api/spotify.ts +++ b/pages/api/spotify.ts @@ -6,7 +6,7 @@ export default async function (req: NextApiRequest, res: NextApiResponse) { const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!) const song = await spotify.getCurrentSong() - if(spotify.error || !song.isPlaying ) { + if(!!song|| !song.isPlaying ) { return res.status(200).json({ nowplaying: false, });