Skip to content

Commit

Permalink
fix(team): error null-properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassimoen committed Oct 22, 2023
1 parent 645a619 commit 29375a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/Team/Team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const _Team = (props: AbstractTeamType) => {
return Object.assign({ inStarting: false, upcomingMatches: displayWeekMatches }, pick(p, playerProps), pick(p.selection, selectionProps));
});

const teamName = teamResult.team.name;
const teamName = useMemo(() => teamResult && teamResult.team.name, [teamResult]);
const captainPlayer = teamResult.players.find((p: Player) => p && p.selection && p.selection.captain === 1);
const captainId = captainPlayer && captainPlayer.id;

Expand Down

0 comments on commit 29375a9

Please sign in to comment.