Fix TypeError when there is no next item in the queue (#398)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 6 Jul 2022 20:22:38 +0000 (22:22 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jul 2022 20:22:38 +0000 (22:22 +0200)
fix TypeError when there is no next item in the queue

music_assistant/models/player_queue.py

index cf87b0fd9a71253490b1a8cdb707150e0fe25529..84462b127cab823c2ca9b0f2e6247e9bc0c0d612 100644 (file)
@@ -154,7 +154,7 @@ class PlayerQueue:
         try:
             next_index = self.get_next_index(self._current_index)
             return self._items[next_index]
-        except IndexError:
+        except (IndexError, TypeError):
             return None
 
     def get_item(self, index: int) -> QueueItem | None: