fix(x/staking): avoid overriding error (backport #23076) (#23195)

Co-authored-by: Marko <marko@baricevic.me>
This commit is contained in:
mergify[bot] 2025-01-06 11:05:05 +01:00 committed by GitHub
parent 773d28c975
commit 3c04752296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -858,9 +858,9 @@ func (k Keeper) getBeginInfo(
return completionTime, height, false, nil
}
headerInfo := k.HeaderService.HeaderInfo(ctx)
unbondingTime, err := k.UnbondingTime(ctx)
if err != nil {
return completionTime, height, false, err
unbondingTime, err2 := k.UnbondingTime(ctx)
if err2 != nil {
return completionTime, height, false, errors.Join(err, err2)
}
// TODO: When would the validator not be found?