mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
consistency: getters return null instead of undefined (#2385)
This commit is contained in:
@@ -301,11 +301,11 @@ class Guild extends Base {
|
||||
|
||||
/**
|
||||
* The owner of the guild
|
||||
* @type {GuildMember}
|
||||
* @type {?GuildMember}
|
||||
* @readonly
|
||||
*/
|
||||
get owner() {
|
||||
return this.members.get(this.ownerID);
|
||||
return this.members.get(this.ownerID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,11 +411,11 @@ class Guild extends Base {
|
||||
|
||||
/**
|
||||
* The `@everyone` role of the guild
|
||||
* @type {Role}
|
||||
* @type {?Role}
|
||||
* @readonly
|
||||
*/
|
||||
get defaultRole() {
|
||||
return this.roles.get(this.id);
|
||||
return this.roles.get(this.id) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -424,7 +424,7 @@ class Guild extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get me() {
|
||||
return this.members.get(this.client.user.id);
|
||||
return this.members.get(this.client.user.id) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user