From 2e1a28a6eeb65b38b381038aa60197583a143ac7 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sun, 29 Oct 2017 18:04:36 +0000 Subject: [PATCH] Use destroy and end in apt places --- src/client/voice/dispatcher/StreamDispatcher.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index 84500bcce..20650c128 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -59,9 +59,9 @@ class StreamDispatcher extends Writable { this._pausedTime = 0; this.count = 0; - this.on('error', this.destroy.bind(this)); + this.on('error', err => this.destroy(err)); this.on('finish', () => { - this.destroy.bind(this); + this.end.bind(this); // Still emitting end for backwards compatibility, probably remove it in the future! this.emit('end'); }); @@ -73,7 +73,7 @@ class StreamDispatcher extends Writable { const streamError = err => { this.emit('warn', err); - this.destroy(); + this.destroy(err); }; if (this.streams.ffmpeg) this.streams.ffmpeg.on('error', streamError);