mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Collection): toJSON() errors if the collection includes empty values (#5129)
This commit is contained in:
@@ -5,7 +5,7 @@ const Util = require('./Util');
|
||||
|
||||
class Collection extends BaseCollection {
|
||||
toJSON() {
|
||||
return this.map(e => (typeof e.toJSON === 'function' ? e.toJSON() : Util.flatten(e)));
|
||||
return this.map(e => (typeof e?.toJSON === 'function' ? e.toJSON() : Util.flatten(e)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user