Skip to content

Commit

Permalink
fix(BaseClient): do not append default options if provided is not an …
Browse files Browse the repository at this point in the history
…object (#6453)
  • Loading branch information
J-Human committed Jan 9, 2022
1 parent caaef53 commit b92a7d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/discord.js/src/client/BaseClient.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const EventEmitter = require('node:events');
const { TypeError } = require('../errors');
const RESTManager = require('../rest/RESTManager');
const Options = require('../util/Options');
const Util = require('../util/Util');
Expand All @@ -13,6 +14,10 @@ class BaseClient extends EventEmitter {
constructor(options = {}) {
super();

if (typeof options !== 'object' || options === null) {
throw new TypeError('INVALID_TYPE', 'options', 'object', true);
}

/**
* The options the client was instantiated with
* @type {ClientOptions}
Expand Down

0 comments on commit b92a7d7

Please sign in to comment.