mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
Merge pull request #73 from SimonSchick/streamerrorfix
Prevent error when trying to close stream by assuming all streams hav…
This commit is contained in:
@@ -61,8 +61,15 @@ export default class VoiceConnection extends EventEmitter {
|
|||||||
this.playing = false;
|
this.playing = false;
|
||||||
this.playingIntent = null;
|
this.playingIntent = null;
|
||||||
if(this.instream){
|
if(this.instream){
|
||||||
this.instream.end();
|
//not all streams implement these...
|
||||||
this.instream.destroy();
|
//and even file stream don't seem to implement them properly...
|
||||||
|
if(this.instream.end) {
|
||||||
|
this.instream.end();
|
||||||
|
}
|
||||||
|
if(this.instream.destroy) {
|
||||||
|
this.instream.destroy();
|
||||||
|
}
|
||||||
|
this.instream = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user