Skip to content

Commit

Permalink
fix: currentIntraScoreId is possibly null
Browse files Browse the repository at this point in the history
  • Loading branch information
FreekBes authored Jan 28, 2025
1 parent a4673d2 commit e92998f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/intrascores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const createIntraScore = async function(prisma: PrismaClient, api: Fast42, score
intra_score_id: true,
},
});
if (currentIntraScoreId.intra_score_id != null) {
if (currentIntraScoreId && currentIntraScoreId.intra_score_id != null) {
console.warn(`Two Intra scores were simultaneously created (probably due to multithreading) for score ${score.id}. Deleting duplicate Intra score ${postBody.id}...`);
const del = await api.delete(`/coalitions/${score.coalition_id}/scores/${postBody.id}`, {});
if (!del.ok) {
Expand Down

0 comments on commit e92998f

Please sign in to comment.