From 97942315a7f9dc918bcbd249b96362a4de6f0844 Mon Sep 17 00:00:00 2001 From: Raul Glogovetan Date: Thu, 25 Nov 2021 13:56:11 +0200 Subject: [PATCH] Fix: `calculatePercentageReputation` prevent division by 0 --- src/utils/reputation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/reputation.ts b/src/utils/reputation.ts index c7b5ecc9ab..82f604b320 100644 --- a/src/utils/reputation.ts +++ b/src/utils/reputation.ts @@ -18,7 +18,7 @@ export const calculatePercentageReputation = ( const reputationSafeguard = bigNumberify(100).pow(decimalPlaces); - if (userReputationNumber.isZero()) { + if (userReputationNumber.isZero() || totalReputationNumber.isZero()) { return ZeroValue.Zero; }