-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle no lens results #825
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: earn/src/data/BorrowerNft.ts
Did you find this useful? React with a 👍 or 👎 |
✅ Deploy Preview for aloe-earn ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for aloe-prime canceled.
|
✅ Deploy Preview for aloe-blend-staging canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should investigate why the lens call is failing. That shouldn't happen.
While I agree, it is failing, so we should have logic to handle such a case. |
Turns out this happens because the multicall context has zero calls. To fix, we should change the enclosing if statement to look like this: // Fetch borrowers' in-use status and Uniswap pool, which we'll need for filtering
if (
(filterParams?.includeFreshBorrowers || Boolean(filterParams?.validUniswapPool)) &&
borrowerManagerSets.size > 0
) (testing that the set is non-empty is the key) |
Adding logic to handle and return early the case where there are no lens results when fetching a list of borrower nfts.