]> kaliko git repositories - mpd-sima.git/commitdiff
Fixed bug in history plugin
authorkaliko <kaliko@azylum.org>
Sat, 26 Sep 2020 16:23:13 +0000 (18:23 +0200)
committerkaliko <kaliko@azylum.org>
Sat, 26 Sep 2020 16:23:13 +0000 (18:23 +0200)
sima/plugins/core/history.py

index b85c0dd923b1cb302237fa299dbcd301b3d14cf6..4876eba3b4c61a6adb6d17c1850d4869506d0f83 100644 (file)
@@ -45,7 +45,7 @@ class History(Plugin):
     def callback_player(self):
         current = self.player.current
         last_hist = next(self.sdb.get_history(), None)
-        if last_hist[3] == current.file:
+        if last_hist and last_hist[3] == current.file:
             return
         if not current:
             self.log.debug('Cannot add "%s" to history (empty or missing file)', current)