Skip to content

Commit 5bea45e

Browse files
committed
Avoid division by zero when totalShares is zero
1 parent b456d4d commit 5bea45e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

protocol/synthetix/contracts/modules/core/RewardsManagerModule.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ contract RewardsManagerModule is IRewardsManagerModule {
276276
// No rewards are currently being distributed if the distributor doesn't exist, they are scheduled to be distributed in the future, or the distribution as already completed
277277
if (
278278
address(vault.rewards[rewardId].distributor) == address(0) ||
279+
totalShares == 0 ||
279280
vault.rewards[rewardId].start > curTime.toUint() ||
280281
vault.rewards[rewardId].start + vault.rewards[rewardId].duration <= curTime.toUint()
281282
) {

0 commit comments

Comments
 (0)