From 18b6463e109b6cbbece4c4ae39efe94ea33487ef Mon Sep 17 00:00:00 2001 From: Mavis Bot Date: Tue, 4 Aug 2026 21:40:52 +0000 Subject: [PATCH] fix: handle null JSON body in Spotify getCurrentlyPlaying response --- services/spotify/api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/spotify/api.ts b/services/spotify/api.ts index 3aeff1791..59f34359d 100644 --- a/services/spotify/api.ts +++ b/services/spotify/api.ts @@ -88,7 +88,12 @@ export async function getCurrentlyPlaying(): Promise { return { isPlaying: false }; } - const data = await response.json(); + let data; + try { + data = await response.json(); + } catch { + return { isPlaying: false }; + } if (!data || !data.item) { return { isPlaying: false };