From 7cf9bcca4e906023722b8d2e01aee34403f18fab Mon Sep 17 00:00:00 2001 From: TheEssem Date: Fri, 5 Mar 2021 22:13:58 -0600 Subject: [PATCH] write stable audio queue code challenge (instantly failed) --- utils/soundplayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/soundplayer.js b/utils/soundplayer.js index 944c1cc..95c1968 100644 --- a/utils/soundplayer.js +++ b/utils/soundplayer.js @@ -71,7 +71,7 @@ exports.play = async (sound, message, music = false) => { } const { tracks } = await fetch(`http://${node.host}:${node.port}/loadtracks?identifier=${sound}`, { headers: { Authorization: node.password } }).then(res => res.json()); const oldQueue = this.queues.get(voiceChannel.guild.id); - if (tracks.length === 0) return `${message.author.mention}, I couldn't find that song!`; + if (!tracks || tracks.length === 0) return `${message.author.mention}, I couldn't find that song!`; if (music) { this.queues.set(voiceChannel.guild.id, oldQueue ? [...oldQueue, tracks[0].track] : [tracks[0].track]); }