From 1dd4c041e08068a8979a14cbdc5be95233634f2d Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Wed, 26 Jun 2019 20:12:05 +0200 Subject: [PATCH] fix(ClientApplication): owner is still nullable Fixes #3358 --- src/structures/ClientApplication.js | 8 ++++++-- typings/index.d.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/structures/ClientApplication.js b/src/structures/ClientApplication.js index ac712bb6a..9288d900f 100644 --- a/src/structures/ClientApplication.js +++ b/src/structures/ClientApplication.js @@ -68,9 +68,13 @@ class ClientApplication extends Base { /** * The owner of this OAuth application - * @type {User|Team} + * @type {?User|Team} */ - this.owner = data.team ? new Team(this.client, data.team) : this.client.users.add(data.owner); + this.owner = data.team ? + new Team(this.client, data.team) ? + data.owner : + this.client.users.add(data.owner) : + null; } /** diff --git a/typings/index.d.ts b/typings/index.d.ts index 8d4c02943..de3255919 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -255,7 +255,7 @@ declare module 'discord.js' { public icon: string; public id: Snowflake; public name: string; - public owner: User | Team; + public owner: User | Team | null; public rpcOrigins: string[]; public coverImage(options?: AvatarOptions): string; public fetchAssets(): Promise;