mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(BaseClient): do not append default options if provided is not an object (#6453)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const EventEmitter = require('node:events');
|
const EventEmitter = require('node:events');
|
||||||
|
const { TypeError } = require('../errors');
|
||||||
const RESTManager = require('../rest/RESTManager');
|
const RESTManager = require('../rest/RESTManager');
|
||||||
const Options = require('../util/Options');
|
const Options = require('../util/Options');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
@@ -13,6 +14,10 @@ class BaseClient extends EventEmitter {
|
|||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
if (typeof options !== 'object' || options === null) {
|
||||||
|
throw new TypeError('INVALID_TYPE', 'options', 'object', true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The options the client was instantiated with
|
* The options the client was instantiated with
|
||||||
* @type {ClientOptions}
|
* @type {ClientOptions}
|
||||||
|
|||||||
Reference in New Issue
Block a user