From 1af15465363706fdb2696eb957dfcbf49174caeb Mon Sep 17 00:00:00 2001 From: Tetrabyte Date: Mon, 4 Dec 2017 21:38:55 -0700 Subject: [PATCH] Checking if the res and res.track is defined Added to the undefined checking so it doesn't error if res or res.track is not defined. --- app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app.js b/app.js index da32137..3527d11 100644 --- a/app.js +++ b/app.js @@ -56,6 +56,7 @@ async function checkSpotify() { return; } + if (!res || !res.track) return; if (!res.track.track_resource || !res.track.artist_resource) return; if (currentSong.uri && res.track.track_resource.uri == currentSong.uri && (res.playing != currentSong.playing)) {