diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-10 22:06:26 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-10 22:06:26 +1000 |
commit | a0c198a56a440b35e893b165cbe0fdfc1f125c4c (patch) | |
tree | 8c47542dd08ba8f3078dece7e1647e9ef1a68368 /api | |
parent | Merge branch 'feat/mobile' into slowcord (diff) | |
download | server-a0c198a56a440b35e893b165cbe0fdfc1f125c4c.tar.xz |
Check if role icon was actually sent or if it's just an empty string
Diffstat (limited to 'api')
-rw-r--r-- | api/src/routes/guilds/#guild_id/roles/#role_id/index.ts | 2 |
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({ |