userinfo: clan can exist but have null fields
This commit is contained in:
parent
7004395b3d
commit
ff8cbabf7a
1 changed files with 5 additions and 4 deletions
|
@ -254,11 +254,12 @@ userinfo.callback = async function (msg, line) {
|
|||
let clanData;
|
||||
if (user.clan) {
|
||||
// TODO: badge emojis via color aproximation of the default presets
|
||||
descLines.push(`**${user.clan.tag}**`);
|
||||
if (user.clan.tag) descLines.push(`**${user.clan.tag}**`);
|
||||
|
||||
clanData = await hf.bot.requestHandler
|
||||
.request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true)
|
||||
.catch(() => {});
|
||||
if (user.clan.identity_guild_id)
|
||||
clanData = await hf.bot.requestHandler
|
||||
.request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
if (anyMember) {
|
||||
|
|
Loading…
Reference in a new issue