Fix TS error: guard getUserDisplayName against undefined user
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
34d4ab44ac
commit
e63f1121f2
1 changed files with 2 additions and 1 deletions
|
|
@ -125,7 +125,8 @@ export async function loader(args: Route.LoaderArgs) {
|
||||||
const ownerMap: Record<string, string> = {};
|
const ownerMap: Record<string, string> = {};
|
||||||
for (const slot of draftSlots) {
|
for (const slot of draftSlots) {
|
||||||
if (slot.team.ownerId) {
|
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;
|
if (name) ownerMap[slot.team.id] = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue