mirror of
https://github.com/danbulant/discord.js
synced 2026-05-26 05:22:15 +00:00
Fix createRole crashing with no data passed
This commit is contained in:
parent
4f5dce65b6
commit
a74fe57eb4
1 changed files with 2 additions and 2 deletions
|
|
@ -860,7 +860,7 @@ class Client extends EventEmitter {
|
|||
|
||||
var perm = server.addRole(res.body);
|
||||
|
||||
if (data.color)
|
||||
if (data && data.color)
|
||||
data.color = Color.toDec(data.color);
|
||||
|
||||
self.guildRoleCreateIgnoreList[res.body.id] = true;
|
||||
|
|
@ -899,7 +899,7 @@ class Client extends EventEmitter {
|
|||
tempRole[key] = data[key];
|
||||
}
|
||||
|
||||
if (isNaN(Color.toDec(data.color))) {
|
||||
if (data && isNaN(Color.toDec(data.color))) {
|
||||
var err = new Error("Invalid Color");
|
||||
reject(err);
|
||||
cb(err);
|
||||
|
|
|
|||
Loading…
Reference in a new issue