diff --git a/src/structures/interfaces/Collector.js b/src/structures/interfaces/Collector.js index 2c4fd158c..0e7f1f956 100644 --- a/src/structures/interfaces/Collector.js +++ b/src/structures/interfaces/Collector.js @@ -76,17 +76,18 @@ class Collector extends EventEmitter { */ handleCollect(...args) { const collect = this.collect(...args); - if (!collect || !this.filter(...args, this.collected)) return; - this.collected.set(collect.key, collect.value); + if (collect && this.filter(...args, this.collected)) { + this.collected.set(collect.key, collect.value); - /** - * Emitted whenever an element is collected. - * @event Collector#collect - * @param {*} element The element that got collected - * @param {...*} args The arguments emitted by the listener - */ - this.emit('collect', collect.value, ...args); + /** + * Emitted whenever an element is collected. + * @event Collector#collect + * @param {*} element The element that got collected + * @param {...*} args The arguments emitted by the listener + */ + this.emit('collect', collect.value, ...args); + } this.checkEnd(); }