From 1f415533f537a14de030733baa45c3ef54b9cc48 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 12 May 2026 21:01:49 +0300 Subject: [PATCH] Fix crash when visiting tournament team page after tournament start who did not check in --- app/features/tournament/loaders/to.$id.teams.$tid.server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/features/tournament/loaders/to.$id.teams.$tid.server.ts b/app/features/tournament/loaders/to.$id.teams.$tid.server.ts index 0614df7bd..875e166f9 100644 --- a/app/features/tournament/loaders/to.$id.teams.$tid.server.ts +++ b/app/features/tournament/loaders/to.$id.teams.$tid.server.ts @@ -17,7 +17,9 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { }); const tournament = await tournamentDataCached({ tournamentId }); - if (!tournament?.ctx.teams.some((t) => t.id === tournamentTeamId)) { + const team = tournament?.ctx.teams.find((t) => t.id === tournamentTeamId); + const tournamentHasStarted = (tournament?.data.stage.length ?? 0) > 0; + if (!team || (tournamentHasStarted && team.checkIns.length === 0)) { throw new Response(null, { status: 404 }); }