From c450828721031bd1a2e7f4cfe45cd8870b36ae84 Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 25 Feb 2018 18:23:04 -0600 Subject: [PATCH] fix crash when nothing is currently playing --- nowplaying.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nowplaying.py b/nowplaying.py index 8935660..1cfe26d 100644 --- a/nowplaying.py +++ b/nowplaying.py @@ -34,6 +34,10 @@ class NowplayingBot(PineappleBot): # grab the track from the last.fm api currently_playing = self.lastfm.get_user(self.config.lastfm_username).get_now_playing() + # don't try to post if nothing is being played + if currently_playing is None: + return + # don't repost if we've already posted about this track if currently_playing.__hash__() == self.last_posted_track: return