Fix https://github.com/matthieugrieger/mumbledj/issues/55: Crash after skipping last song of playlist

This commit is contained in:
Matthieu Grieger 2015-03-28 16:12:14 -07:00
parent b6c5310240
commit ccb0b4a3de
2 changed files with 4 additions and 1 deletions

View file

@ -1,6 +1,9 @@
MumbleDJ Changelog
==================
### March 28, 2015 -- `v2.6.10`
* Fixed a crash that would occur when the last song of a playlist was skipped.
### March 27, 2015 -- `v2.6.9`
* Fixed a race condition that would sometimes cause the bot to crash (thanks [dylanetaft](https://github.com/dylanetaft)!).

View file

@ -43,7 +43,7 @@ func (q *SongQueue) CurrentSong() *Song {
func (q *SongQueue) NextSong() {
if q.CurrentSong().playlist != nil {
if s, err := q.PeekNext(); err == nil {
if q.CurrentSong().playlist.id != s.playlist.id {
if s.playlist != nil && (q.CurrentSong().playlist.id != s.playlist.id) {
q.CurrentSong().playlist.DeleteSkippers()
}
} else {