From 2b9394a37147aa460dd97cd2cc39b28233730f6c Mon Sep 17 00:00:00 2001 From: Jake Date: Tue, 17 Feb 2015 23:39:37 +0000 Subject: [PATCH] Fixed panic when attempting to play empty queue --- commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 7560cdb..2c4c556 100644 --- a/commands.go +++ b/commands.go @@ -210,7 +210,7 @@ func add(user *gumble.User, username, url string) { oldLength := dj.queue.Len() if newPlaylist, err := NewPlaylist(username, shortUrl); err == nil { dj.client.Self.Channel.Send(fmt.Sprintf(PLAYLIST_ADDED_HTML, username, newPlaylist.title), false) - if oldLength == 0 && !dj.audioStream.IsPlaying() { + if oldLength == 0 && dj.queue.Len() != 0 && !dj.audioStream.IsPlaying() { if err := dj.queue.CurrentSong().Download(); err == nil { dj.queue.CurrentSong().Play() } else {