fix crash when nothing is currently playing
This commit is contained in:
parent
9b2c92afcd
commit
c450828721
1 changed files with 4 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ class NowplayingBot(PineappleBot):
|
||||||
# grab the track from the last.fm api
|
# grab the track from the last.fm api
|
||||||
currently_playing = self.lastfm.get_user(self.config.lastfm_username).get_now_playing()
|
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
|
# don't repost if we've already posted about this track
|
||||||
if currently_playing.__hash__() == self.last_posted_track:
|
if currently_playing.__hash__() == self.last_posted_track:
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue