userinfo: clan can exist but have null fields

This commit is contained in:
Cynthia Foxwell 2024-08-14 11:56:04 -06:00
parent 7004395b3d
commit ff8cbabf7a

View file

@ -254,11 +254,12 @@ userinfo.callback = async function (msg, line) {
let clanData; let clanData;
if (user.clan) { if (user.clan) {
// TODO: badge emojis via color aproximation of the default presets // 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 if (user.clan.identity_guild_id)
.request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true) clanData = await hf.bot.requestHandler
.catch(() => {}); .request("GET", APIEndpoints.CLAN(user.clan.identity_guild_id), true)
.catch(() => {});
} }
if (anyMember) { if (anyMember) {