summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-10 22:06:26 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-10 22:06:26 +1000
commit3f59a5b529714c9a72045d9352a1ca95e63ed182 (patch)
tree95eb55a9d97837840c4e39e578e909b17f6bcbf5
parentMerge branch 'feat/mobile' into slowcord (diff)
downloadserver-3f59a5b529714c9a72045d9352a1ca95e63ed182.tar.xz
Check if role icon was actually sent or if it's just an empty string
-rw-r--r--api/src/routes/guilds/#guild_id/roles/#role_id/index.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/guilds/#guild_id/roles/#role_id/index.ts b/api/src/routes/guilds/#guild_id/roles/#role_id/index.ts
index f3d707e0..16b5a59f 100644
--- a/api/src/routes/guilds/#guild_id/roles/#role_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/roles/#role_id/index.ts
@@ -41,7 +41,7 @@ router.patch("/", route({ body: "RoleModifySchema", permission: "MANAGE_ROLES" }
 	const { role_id, guild_id } = req.params;
 	const body = req.body as RoleModifySchema;
 
-	if (body.icon) body.icon = await handleFile(`/role-icons/${role_id}`, body.icon as string);
+	if (body.icon && body.icon.length) body.icon = await handleFile(`/role-icons/${role_id}`, body.icon as string);
 	else body.icon = undefined;
 
 	const role = new Role({