empty rewards from GET distribution/delegators/{delegatorAddress}/rewards should return [] instead of null
It also crashes for empty validator rewards:
GET distribution/delegators/{delegatorAddress}/rewards/{validatorAddress}
{"message":"ABCIQuery: Response error: RPC error -32603 - Internal error: runtime error: invalid memory address or nil pointer dereference"}
Yeah I remember making a comment about this during the distribution REST/CLI PR. It's fixable, we just need some custom result handling logic -- nothing major.
@fedekunze Are there any other endpoints that exhibit this behavior? I would imagine yes. Ideally we fix all these in 1 PR. Also should it return a 404 instead of []?
I think [] needs less logic client side to handle the response.
@faboweb what you're describing was fixed in #4047.
Most helpful comment
Yeah I remember making a comment about this during the distribution REST/CLI PR. It's fixable, we just need some custom result handling logic -- nothing major.