From 1e00de57a75cd046a63fbed26d82444a427e7948 Mon Sep 17 00:00:00 2001 From: Juruel Keanu Lorenzo <39931559+JKLorenzo@users.noreply.github.com> Date: Fri, 11 Jun 2021 21:00:09 +0800 Subject: [PATCH] fix: use default bit if overwrite is undefined --- src/structures/PermissionOverwrites.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/structures/PermissionOverwrites.js b/src/structures/PermissionOverwrites.js index f0f039866923..1e6b2b2fcf58 100644 --- a/src/structures/PermissionOverwrites.js +++ b/src/structures/PermissionOverwrites.js @@ -178,8 +178,8 @@ class PermissionOverwrites { return { id: overwrite.id, type: OverwriteTypes[overwrite.type], - allow: Permissions.resolve(overwrite.allow).toString(), - deny: Permissions.resolve(overwrite.deny).toString(), + allow: Permissions.resolve(overwrite.allow ?? Permissions.defaultBit).toString(), + deny: Permissions.resolve(overwrite.deny ?? Permissions.defaultBit).toString(), }; } @@ -190,8 +190,8 @@ class PermissionOverwrites { return { id: userOrRole.id, type, - allow: Permissions.resolve(overwrite.allow).toString(), - deny: Permissions.resolve(overwrite.deny).toString(), + allow: Permissions.resolve(overwrite.allow ?? Permissions.defaultBit).toString(), + deny: Permissions.resolve(overwrite.deny ?? Permissions.defaultBit).toString(), }; } }