Fix crash on role update (#648)

This commit is contained in:
Programmix
2016-09-06 21:26:34 -07:00
committed by Schuyler Cebulskie
parent b7f582b7f0
commit ab4707f9b4

View File

@@ -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) {