fix(Integration): user might not be present (#4691)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Advaith
2020-08-12 00:30:34 -07:00
committed by GitHub
parent b7740d4859
commit baffbdb541
2 changed files with 8 additions and 6 deletions

View File

@@ -58,11 +58,13 @@ class Integration extends Base {
*/
this.role = this.guild.roles.cache.get(data.role_id);
/**
* The user for this integration
* @type {User}
*/
this.user = this.client.users.add(data.user);
if (data.user) {
/**
* The user for this integration
* @type {?User}
*/
this.user = this.client.users.add(data.user);
}
/**
* The account integration information