Skip to content

Commit ab03549

Browse files
Check for yieldRewardsFlag before accessing storage.
1 parent 4f23a4d commit ab03549

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

contracts/talent/TalentVaultV3.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ contract TalentVaultV3 is ERC4626, Ownable, ReentrancyGuard {
278278
/// @param user The address to calculate the accrued rewards for
279279
/// @return The amount of accrued rewards for the user
280280
function calculateRewards(address user) public view returns (uint256) {
281-
UserBalanceMeta storage balanceMeta = userBalanceMeta[user];
282-
283281
if (!yieldRewardsFlag) {
284282
return 0;
285283
}
286284

285+
UserBalanceMeta storage balanceMeta = userBalanceMeta[user];
286+
287287
uint256 userBalance = balanceOf(user);
288288

289289
uint256 endTime;

0 commit comments

Comments
 (0)