Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 16cce3f

Browse files
committed
Fix a bug in player setting current track to None on TrackStuck and TrackException.
Since Lavalink sends two events on Exceptions, a End and Exception event this causes a possible race condition in the player, setting the current Track to None when one is actually playing.
1 parent f73a9b0 commit 16cce3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wavelink/player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ async def _dispatch_voice_update(self) -> None:
236236
await self.node._send(op='voiceUpdate', guildId=str(self.guild_id), **self._voice_state)
237237

238238
async def hook(self, event) -> None:
239-
if isinstance(event, (TrackEnd, TrackException, TrackStuck)):
239+
if isinstance(event, TrackEnd):
240240
self.current = None
241241

242242
def _get_shard_socket(self, shard_id: int) -> Optional[DiscordWebSocket]:

0 commit comments

Comments
 (0)