From 2bf8a3607700f03542fad6a363a3c73dbda6ac5b Mon Sep 17 00:00:00 2001 From: aemino Date: Mon, 1 May 2017 10:01:28 -0700 Subject: [PATCH] Allow await endpoint stage to not error (#1444) --- src/client/voice/VoiceConnection.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js index dbc5abf55..36727e7e8 100644 --- a/src/client/voice/VoiceConnection.js +++ b/src/client/voice/VoiceConnection.js @@ -169,19 +169,20 @@ class VoiceConnection extends EventEmitter { * @returns {void} */ setTokenAndEndpoint(token, endpoint) { - if (!token) { - this.authenticateFailed('Token not provided from voice server packet.'); + if (!endpoint) { + // Signifies awaiting endpoint stage return; } - if (!endpoint) { - this.authenticateFailed('Endpoint not provided from voice server packet.'); + + if (!token) { + this.authenticateFailed('Token not provided from voice server packet.'); return; } endpoint = endpoint.match(/([^:]*)/)[0]; if (!endpoint) { - this.authenticateFailed('Failed to find an endpoint.'); + this.authenticateFailed('Invalid endpoint received.'); return; }