From d5f31f8eb0fff63fceacb9932a645c5718524813 Mon Sep 17 00:00:00 2001 From: Darya Kaviani Date: Fri, 15 Jul 2022 22:46:20 -0700 Subject: [PATCH] position null case --- packages/frontend/src/state/lp/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/state/lp/hooks.ts b/packages/frontend/src/state/lp/hooks.ts index 306fee297..2781a20be 100644 --- a/packages/frontend/src/state/lp/hooks.ts +++ b/packages/frontend/src/state/lp/hooks.ts @@ -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)