Skip to content

Software indicator: attributeReviewers sometimes fails because levelEvaluation is undefined

On the indicator page /software/[software-slug]/indicator we sometimes see the following error:

TypeError: can't access property "reviewer", levelEvaluation is undefined
components/software/indicator/SoftwareQualityEvaluationContext.tsx (188:11) @ attributeReviewers/<

  186 |     // FIXME it seems that sometimes we get a levelEvaluation that is undefined here
  187 |     Object.values(attributeData).map((levelEvaluation) => {
> 188 |       if (typeof levelEvaluation.reviewer !== 'string') {
      |           ^
  189 |         reviewers.push(levelEvaluation.reviewer.given_names + ' ' + levelEvaluation.reviewer.family_names)
  190 |       } else {
  191 |         reviewers.push(levelEvaluation.reviewer)

It does not always happen and might be related to the order in which the data is loaded from the backend. Probably there is a missing data dependency somewhere.