Skip to content

Commit

Permalink
Fix: calculatePercentageReputation prevent division by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rdig committed Nov 25, 2021
1 parent 7479d9a commit 9794231
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/reputation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const calculatePercentageReputation = (

const reputationSafeguard = bigNumberify(100).pow(decimalPlaces);

if (userReputationNumber.isZero()) {
if (userReputationNumber.isZero() || totalReputationNumber.isZero()) {
return ZeroValue.Zero;
}

Expand Down

0 comments on commit 9794231

Please sign in to comment.