Skip to content

Commit

Permalink
Fix condition check for writing score.total = null
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Nov 22, 2024
1 parent 0ede015 commit 6d6e1c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ export async function fetchValidators(params: FetchValidatorsOptions): Result<Fe
validators.forEach((v) => {
if (!v.score)
return
if ((v.score.dominance === null && v.score.dominance! < 0) || (v.score.reliability === null && v.score.reliability! < 0) || (v.score.availability === null && v.score.availability! < 0)) {
if (
(v.score.dominance === null || v.score.dominance < 0)
|| (v.score.reliability === null || v.score.reliability < 0)
|| (v.score.availability === null || v.score.availability < 0)
) {
v.score.total = null
}
})
Expand Down

0 comments on commit 6d6e1c3

Please sign in to comment.