From 69dcfa0708b3a2d0baebad6b3dcedd50f090cf23 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sun, 8 Oct 2017 19:39:52 -0500 Subject: [PATCH] fix Client#login from other invalid things (#2013) --- src/client/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/Client.js b/src/client/Client.js index 42688ef97..b55b750f8 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -259,7 +259,7 @@ class Client extends BaseClient { */ login(token) { return new Promise((resolve, reject) => { - if (typeof token !== 'string') throw new Error('TOKEN_INVALID'); + if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID'); token = token.replace(/^Bot\s*/i, ''); this.manager.connectToWebSocket(token, resolve, reject); }).catch(e => {