The delegationsAndRewards
handler crashes on an empty response
#125
Labels
delegationsAndRewards
handler crashes on an empty response
#125
What Git revision are you using?
4416988
What operating system are you using, and which version?
Unrelated
Describe what the problem is?
The
delegationsAndRewards
query in the client assumes at least one entry must be in the response by calling this function:ogmios/clients/TypeScript/packages/client/src/StateQuery/queries/delegationsAndRewards.ts
Lines 15 to 17 in 4e2ae0e
In case if the requested address has no rewards and has no delegation - the response is an empty object. In this case the
entry
variable in the function is undefined and then the callentry[0]
fails with an exception.What should be the expected behavior?
Expecting that it will return the empty response object with no entry for that address, or insert an empty entry, idk.
Workaround
Working around that by just doing the query manually atm and doing the handling on our side.
The text was updated successfully, but these errors were encountered: