Skip to content

Commit

Permalink
fix: handle empty array (gitcoinco#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt authored Nov 28, 2024
1 parent 2f0f640 commit dfd1419
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/features/checker/utils/mapApplicationsForOverviewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export function categorizeProjectReviews(
applicationCounts.pending += 1;
applicationCounts.total += 1;

if (!application.evaluations) {
application.evaluations = [];
}

// Separate evaluations into AI and non-AI
const aiEvaluations = application.evaluations.filter(
(evaluation) => evaluation.evaluator.toLowerCase() === AI_EVALUATOR_ADDRESS.toLowerCase(),
Expand Down

0 comments on commit dfd1419

Please sign in to comment.