Skip to content

Commit

Permalink
Fix crash on role update (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
aemino authored and Gawdl3y committed Sep 7, 2016
1 parent b7f582b commit ab4707f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/rest/RESTMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ab4707f

Please sign in to comment.