From ace34838e26e004cf439903da4bd3f1dc6229bb1 Mon Sep 17 00:00:00 2001 From: sugiish <18275411+sugiish@users.noreply.github.com> Date: Thu, 27 Jan 2022 19:10:10 +0900 Subject: [PATCH] fix(play): undefined when stop command is called in loop mode (#1059) --- include/play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/play.js b/include/play.js index c4a6c566f..711fce4ff 100644 --- a/include/play.js +++ b/include/play.js @@ -64,7 +64,7 @@ module.exports = { queue.connection.removeAllListeners("disconnect"); - if (queue.loop) { + if (queue.loop && queue.songs.length > 0) { // if loop is on, push the song back at the end of the queue // so it can repeat endlessly let lastSong = queue.songs.shift();