From 3f59a5b529714c9a72045d9352a1ca95e63ed182 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 10 Jul 2022 22:06:26 +1000 Subject: [PATCH] Check if role icon was actually sent or if it's just an empty string --- api/src/routes/guilds/#guild_id/roles/#role_id/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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({