fix: handle unauthorized guild roles by defaulting to an empty array
This commit is contained in:
@@ -73,7 +73,7 @@ export async function getDiscordMemberProfile(discordId: string) {
|
|||||||
headers: { Authorization: `Bot ${token}` },
|
headers: { Authorization: `Bot ${token}` },
|
||||||
cache: "no-store",
|
cache: "no-store",
|
||||||
}),
|
}),
|
||||||
getGuildRoles()
|
getGuildRoles().catch(() => []) // Fallback to empty array if unauthorized
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!memberRes.ok) return null;
|
if (!memberRes.ok) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user