fix: Invariant crash when adding liquidity #10661
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It happens some of the no-liquidity/not yet created pools with min/max price on the params
https://pancakeswap.finance/add/0xCF18E4ff8433D32d8d2CC17C7674dbAea01DBA63/BNB/100?minPrice=0.000000000000000000&maxPrice=340256786836388094070642339899681172762.184832000000000000
PR-Codex overview
This PR improves error handling in the
RangeSelector
component by wrapping logic intry-catch
blocks. This ensures that if an error occurs during the calculation of price values, the function will return an empty string instead of potentially causing a runtime error.Detailed summary
try-catch
blocks around price calculations forleftPrice
andrightPrice
.tickSpaceLimits
.