diff --git a/backend/handlers/handle_spotify.go b/backend/handlers/handle_spotify.go index 07c2db1..8f9d97d 100644 --- a/backend/handlers/handle_spotify.go +++ b/backend/handlers/handle_spotify.go @@ -34,6 +34,11 @@ func (store *Store) CompleteAuth(c *gin.Context) { func (store *Store) ListeningTo(c *gin.Context) { ctx := c.Request.Context() + if store.SpotifyClient == nil { + c.JSON(500, gin.H{"error": "Spotify not authenticated"}) + return + } + playing, err := store.SpotifyClient.PlayerCurrentlyPlaying(ctx) if err != nil { c.JSON(500, gin.H{"error": err.Error()})