Skip to content

Commit

Permalink
Ratings edge case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TyHil committed Dec 30, 2023
1 parent 0378ee4 commit 0688f27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export async function buildProfessorProfiles(payload: ShowCourseTabPayload) {
ratingsDistribution: rmps[i]
? Object.values(rmps[i].ratingsDistribution).reverse().slice(1)
: [],
totalRatings: rmps[i].ratingsDistribution.total,
totalRatings: rmps[i]?.ratingsDistribution?.total ?? 0,
});
}
return professorProfiles;
Expand Down

0 comments on commit 0688f27

Please sign in to comment.