From 466e9189c6024610c65c0d840af4cb2f1c4fedb1 Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Sun, 14 Aug 2016 10:00:38 -0700 Subject: [PATCH] Fix https://github.com/matthieugrieger/mumbledj/issues/172: Index out of range error during skip --- CHANGELOG.md | 3 +++ bot/queue.go | 2 +- main.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45aa84be..b9d1c4c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ MumbleDJ Changelog ================== +### August 14, 2016 -- `v3.1.2` +* Fixed an index out of range crash in the queue skipping function. + ### July 11, 2016 -- `v3.1.1` * Updated vendored dependencies to hopefully address the following issue: https://github.com/matthieugrieger/mumbledj/issues/169. diff --git a/bot/queue.go b/bot/queue.go index 6db94ed7..a14b798c 100644 --- a/bot/queue.go +++ b/bot/queue.go @@ -199,7 +199,7 @@ func (q *Queue) Skip() { q.mutex.Lock() // If caching is disabled, delete the track from disk. - if !viper.GetBool("cache.enabled") { + if q.Length() != 0 && !viper.GetBool("cache.enabled") { DJ.YouTubeDL.Delete(q.Queue[0]) } diff --git a/main.go b/main.go index 9add04ae..a55b2abe 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,7 @@ func init() { services.DJ = DJ bot.DJ = DJ - DJ.Version = "v3.1.1" + DJ.Version = "v3.1.2" logrus.SetLevel(logrus.WarnLevel) }