Skip to content

Commit

Permalink
position null case
Browse files Browse the repository at this point in the history
  • Loading branch information
Darya Kaviani authored and Darya Kaviani committed Aug 9, 2022
1 parent ba1c8f8 commit d5f31f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/state/lp/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const useRebalanceGeneralSwap = () => {
async (vaultId: number, lowerTickInput: number, upperTickInput: number, onTxConfirmed?: () => void) => {
const vaultBefore = await getVault(vaultId)
const uniTokenId = vaultBefore?.NFTCollateralId
const position = await getPosition(uniTokenId)
const position = uniTokenId ? await getPosition(uniTokenId) : null
if (!controllerContract || !controllerHelperContract || !address || !position || !vaultBefore || !squeethPoolContract) return
const shortAmount = fromTokenAmount(vaultBefore.shortAmount, OSQUEETH_DECIMALS)
const debtInEth = await getDebtAmount(shortAmount)
Expand Down

0 comments on commit d5f31f8

Please sign in to comment.