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)