Added some checks so the player doesnt crash because of things removed in latest commits.
This commit is contained in:
parent
c164201a55
commit
cf1b4bacd1
1 changed files with 3 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue