Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
fix: crash triggering by stop and play when playlist is empty, fixed #…
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryGeng committed Sep 20, 2020
1 parent 1419777 commit fceb50e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mumbleBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,16 @@ def clear(self):
# Kill the ffmpeg thread and empty the playlist
self.interrupt()
var.playlist.clear()
self.wait_for_ready = False
self.log.info("bot: music stopped. playlist trashed.")

def stop(self):
self.interrupt()
self.is_pause = True
var.playlist.next()
self.wait_for_ready = True
if len(var.playlist) > 0:
self.wait_for_ready = True
else:
self.wait_for_ready = False
self.log.info("bot: music stopped.")

def interrupt(self):
Expand Down

0 comments on commit fceb50e

Please sign in to comment.