Skip to content

Commit

Permalink
Avoid division by zero when totalShares is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Jun 14, 2024
1 parent b456d4d commit 5bea45e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ contract RewardsManagerModule is IRewardsManagerModule {
// 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
if (
address(vault.rewards[rewardId].distributor) == address(0) ||
totalShares == 0 ||
vault.rewards[rewardId].start > curTime.toUint() ||
vault.rewards[rewardId].start + vault.rewards[rewardId].duration <= curTime.toUint()
) {
Expand Down

0 comments on commit 5bea45e

Please sign in to comment.