Skip to content

Commit

Permalink
fix possible null error
Browse files Browse the repository at this point in the history
  • Loading branch information
CassandraGoose committed Mar 22, 2024
1 parent 880505e commit 2aa0314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const caluclateProgress = (pathway: Pathway) => {
let totalCompetencies = 0;
const total = pathway.competencies.reduce((acc, competency) => {
totalCompetencies++;
return competency.proofs.length > 0 ? acc + 1 : acc;
return competency!.proofs!.length > 0 ? acc + 1 : acc;
}, 0);
return (total / totalCompetencies) * 100;
};

0 comments on commit 2aa0314

Please sign in to comment.