We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7552855 commit 53441abCopy full SHA for 53441ab
src/utils/getAvatar.ts
@@ -57,9 +57,11 @@ function getAvatar(
57
user: APIUser,
58
{ animated = false, size = 80, forceDefault = false }: GetAvatarOptions = {}
59
): string {
60
- const defaultAvatar = `https://cdn.discordapp.com/embed/avatars/${
61
- Number(BigInt(user.id) >> 22n) % 6
62
- }.png`;
+ const defaultAvatarIndex = isNaN(Number(user.id))
+ ? 0
+ : Number(BigInt(user.id) >> 22n) % 6;
63
+
64
+ const defaultAvatar = `https://cdn.discordapp.com/embed/avatars/${defaultAvatarIndex}.png`;
65
66
const avatarUrl = getAvatarProperty(user, size);
67
0 commit comments