From 88730266ffec073b947821948b8f99630aa63f59 Mon Sep 17 00:00:00 2001 From: ITOH Date: Wed, 9 Dec 2020 16:50:20 +0100 Subject: [PATCH] Bug fix --- src/handlers/channel.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/handlers/channel.ts b/src/handlers/channel.ts index 7b930a76c..41b16b036 100644 --- a/src/handlers/channel.ts +++ b/src/handlers/channel.ts @@ -440,15 +440,15 @@ export async function editChannelOverwrite( const { allow, deny, ...info } = overwrite; let channel = cache.channels.get(channelID); - if (!channel) return Errors.CHANNEL_NOT_FOUND; + if (!channel) throw new Error(Errors.CHANNEL_NOT_FOUND); const payload = { permission_overwrites: [ - ...(channel?.permissionOverwrites || []).map((ro) => ({ - id: ro.id, - type: ro.type, - allow: ro.allow, - deny: ro.deny, + ...(channel?.permissionOverwrites || []).map((rawOverwrite) => ({ + id: rawOverwrite.id, + type: rawOverwrite.type, + allow: rawOverwrite.allow, + deny: rawOverwrite.deny, })), { ...info,