Added some checks so the player doesnt crash because of things removed in latest commits.

This commit is contained in:
The Wobbler 2025-02-04 11:17:35 +01:00
parent c164201a55
commit cf1b4bacd1

View file

@ -46,15 +46,15 @@ class TrackControl(QToolBar):
self.next_button.triggered.connect(self.next_track)
def previous_track(self):
if self.app.player.current_playlist.has_tracks():
if self.app.player.current_playlist is not None and self.app.player.current_playlist.has_tracks():
self.app.player.previous_track()
def stop(self):
if self.app.player.current_playlist.has_tracks():
if self.app.player.current_playlist is not None and self.app.player.current_playlist.has_tracks():
self.app.player.stop()
def next_track(self):
if self.app.player.current_playlist.has_tracks():
if self.app.player.current_playlist is not None and self.app.player.current_playlist.has_tracks():
self.app.player.next_track()
def on_track_change(self, previous_track, track):