Skip to content

Commit

Permalink
fix: nil pointer exception bug in HasChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasos Bitsios committed Jan 23, 2025
1 parent 75c883f commit f497b8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/algod/participation/participation.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func boolToInt(input bool) int {
return 0
}
func HasChanged(part api.ParticipationKey, account *api.AccountParticipation) (Diff, bool, int) {
if account == nil {
diff := Diff{VoteFirstValid: true, VoteLastValid: true, VoteKeyDilution: true, VoteParticipationKey: true, SelectionParticipationKey: true, StateProofKey: true}
return diff, true, 0
}

Check warning on line 124 in internal/algod/participation/participation.go

View check run for this annotation

Codecov / codecov/patch

internal/algod/participation/participation.go#L121-L124

Added lines #L121 - L124 were not covered by tests
diff := Diff{
VoteFirstValid: account.VoteFirstValid != part.Key.VoteFirstValid,
VoteLastValid: account.VoteLastValid != part.Key.VoteLastValid,
Expand Down

0 comments on commit f497b8c

Please sign in to comment.