mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Fix crash on role update (#648)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
b7f582b7f0
commit
ab4707f9b4
@@ -387,7 +387,9 @@ class RESTMethods {
|
||||
data.name = _data.name || role.name;
|
||||
data.position = _data.position || role.position;
|
||||
data.color = _data.color || role.color;
|
||||
if (data.color.startsWith('#')) data.color = parseInt(data.color.replace('#', ''), 16);
|
||||
if (typeof data.color === 'string' && data.color.startsWith('#')) {
|
||||
data.color = parseInt(data.color.replace('#', ''), 16);
|
||||
}
|
||||
data.hoist = typeof _data.hoist !== 'undefined' ? _data.hoist : role.hoist;
|
||||
|
||||
if (_data.permissions) {
|
||||
|
||||
Reference in New Issue
Block a user