From 51e59256ef1a74d451a0475a6e97fb722f5ff7cd Mon Sep 17 00:00:00 2001 From: Matt Young Date: Sat, 15 Jun 2024 15:33:25 -0500 Subject: [PATCH] Fix bug when no scores exist for an entry --- app/Services/TabulationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/TabulationService.php b/app/Services/TabulationService.php index 7bd24d4..cbd9ba6 100644 --- a/app/Services/TabulationService.php +++ b/app/Services/TabulationService.php @@ -129,7 +129,7 @@ class TabulationService // Iterate over the auditions and calculate the scored_entries_count return $auditions->map(function ($audition) use ($scoreCountByEntry) { $audition->scored_entries_count = $audition->entries->reduce(function ($carry, $entry) use ($audition, $scoreCountByEntry) { - $entry->fully_scored = $audition->judges_count == $scoreCountByEntry[$entry->id]; + $entry->fully_scored = $audition->judges_count == $scoreCountByEntry->has($entry->id) ? $scoreCountByEntry[$entry->id] : false; return $carry + ($entry->fully_scored ? 1 : 0); }, 0); return $audition;