diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index b88b17cd57f8..606cb1e51c89 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -1031,7 +1031,7 @@ func (k Keeper) Unbond( } valAddr, err1 := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) - if err != nil { + if err1 != nil { return amount, err1 } diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index 5754ef990c0b..4b089da7800a 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -41,10 +41,6 @@ func (k Keeper) GetDelegatorValidators( i++ } - if err != nil { - return types.Validators{}, err - } - return types.Validators{Validators: validators[:i], ValidatorCodec: k.validatorAddressCodec}, nil // trim }