voice: fix disconnect without receiver edge case

This commit is contained in:
Amish Shah
2018-10-11 23:02:59 +01:00
parent 4491b7b42a
commit 2e7094f9ea

View File

@@ -180,7 +180,7 @@ class VoiceWebSocket extends EventEmitter {
this.connection.ssrcMap.set(+packet.d.audio_ssrc, packet.d.user_id);
break;
case VoiceOPCodes.CLIENT_DISCONNECT:
const streamInfo = this.connection.receiver.packets.streams.get(packet.d.user_id);
const streamInfo = this.connection.receiver && this.connection.receiver.packets.streams.get(packet.d.user_id);
if (streamInfo) {
this.connection.receiver.packets.streams.delete(packet.d.user_id);
streamInfo.stream.push(null);