mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(ThreadManager): Fix internal crash upon conditionally resolving thread members (#9648)
* fix(ThreadManager): Fix crash * chore: prettier --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -188,10 +188,10 @@ class ThreadManager extends CachedManager {
|
||||
}, new Collection());
|
||||
|
||||
// Discord sends the thread id as id in this object
|
||||
const threadMembers = rawThreads.members.reduce(
|
||||
(coll, raw) => coll.set(raw.user_id, threads.get(raw.id).members._add(raw)),
|
||||
new Collection(),
|
||||
);
|
||||
const threadMembers = rawThreads.members.reduce((coll, raw) => {
|
||||
const thread = threads.get(raw.id);
|
||||
return thread ? coll.set(raw.user_id, thread.members._add(raw)) : coll;
|
||||
}, new Collection());
|
||||
|
||||
const response = { threads, members: threadMembers };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user