From ff8cbabf7af3e3ba819addec99975c01dd5a6076 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 14 Aug 2024 11:56:04 -0600 Subject: [PATCH] userinfo: clan can exist but have null fields --- src/modules/utility/userinfo.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/utility/userinfo.js b/src/modules/utility/userinfo.js index 21eb591..9e39c63 100644 --- a/src/modules/utility/userinfo.js +++ b/src/modules/utility/userinfo.js @@ -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) {