Skip to content

Commit

Permalink
Handle user image not found (#2035)
Browse files Browse the repository at this point in the history
If there is no image then fallback to an empty string
  • Loading branch information
Shadowner authored Mar 10, 2023
1 parent c5ef8a1 commit 0fe1376
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/src/lib/leaderboard_utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const updateUsersProfilePictures = async <T extends { auth_method: string
return entires.map((entry, idx) => ({
...entry,
// NOTE: findMany will return the values unsorted, which is why we have to 'find' here
image: items.find((i) => i.id === frontendUserIds[idx]).image,
// TODO: Check why there is no image for a better fix
image: items.find((i) => i.id === frontendUserIds[idx])?.image || "",
}));
};

0 comments on commit 0fe1376

Please sign in to comment.