mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
voice: delete receive stream immediately to prevent it being written to after end (#2678)
This commit is contained in:
@@ -184,7 +184,10 @@ class VoiceWebSocket extends EventEmitter {
|
||||
case VoiceOPCodes.CLIENT_DISCONNECT:
|
||||
for (const receiver of this.connection.receivers) {
|
||||
const streamInfo = receiver.packets.streams.get(packet.d.user_id);
|
||||
if (streamInfo) streamInfo.stream.push(null);
|
||||
if (streamInfo) {
|
||||
receiver.packets.streams.delete(packet.d.user_id);
|
||||
streamInfo.stream.push(null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VoiceOPCodes.SPEAKING:
|
||||
|
||||
Reference in New Issue
Block a user