From 101e427084e56a0a697793fa53e4032438f1cd1c Mon Sep 17 00:00:00 2001 From: ShootGan Date: Sat, 30 Mar 2024 23:40:17 +0100 Subject: [PATCH] Fix index error Co-authored-by: Rakkuzan --- src/cogs/audio_cog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cogs/audio_cog.py b/src/cogs/audio_cog.py index 2fc7b0e..b41f877 100644 --- a/src/cogs/audio_cog.py +++ b/src/cogs/audio_cog.py @@ -214,8 +214,9 @@ async def __search_tracks( search_result = await wavelink.Playable.search(safe_url) else: search_result = await wavelink.Playable.search(search_phrase) - - tracks = search_result[0] + + tracks = search_result[0] if search_result else [] + if not tracks: raise YoutubeTrackNotFound