Fix TS error: guard getUserDisplayName against undefined user

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Parsons 2026-04-26 22:26:26 -07:00
parent 34d4ab44ac
commit e63f1121f2

View file

@ -125,7 +125,8 @@ export async function loader(args: Route.LoaderArgs) {
const ownerMap: Record<string, string> = {};
for (const slot of draftSlots) {
if (slot.team.ownerId) {
const name = getUserDisplayName(userById.get(slot.team.ownerId));
const user = userById.get(slot.team.ownerId);
const name = user ? getUserDisplayName(user) : null;
if (name) ownerMap[slot.team.id] = name;
}
}