Skip to content

Commit

Permalink
bug fix: array index out of bounds fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Jun 15, 2024
1 parent c4e01b1 commit fc34ad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/KukaiCoreSwift/Clients/TzKTClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public class TzKTClient {


// If we don't have enough objects to fetch, can't compute previous, early exit
if currentDelegatorRewards.count < previousRewardIndex {
if currentDelegatorRewards.count-1 < previousRewardIndex {
let nextPossibleReward = self?.tryToGetFutureRewardFromLimitedData(bakerConfigs: bakerConfigs, rewards: currentDelegatorRewards, cycles: currentCycles)
DispatchQueue.main.async { completion(Result.success(AggregateRewardInformation(previousReward: pReward, estimatedPreviousReward: nil, estimatedNextReward: nextPossibleReward))) }
return
Expand Down

0 comments on commit fc34ad4

Please sign in to comment.