From ccb0b4a3de270aa7452650b10dc83c172b66231d Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Sat, 28 Mar 2015 16:12:14 -0700 Subject: [PATCH] Fix https://github.com/matthieugrieger/mumbledj/issues/55: Crash after skipping last song of playlist --- CHANGELOG.md | 3 +++ songqueue.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d8e00..88af354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)!). diff --git a/songqueue.go b/songqueue.go index 85daf11..270e06f 100644 --- a/songqueue.go +++ b/songqueue.go @@ -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 {