Skip to content

Commit

Permalink
fix: check l1ToL2Msg for undefined in batch transfers (#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx authored Sep 30, 2024
1 parent 3ee23f7 commit 12d058d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/arb-token-bridge-ui/src/util/deposits/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const updateAdditionalDepositData = async ({
}

const { value2 } = await getBatchTransferDepositData({
l1ToL2Msg: parentToChildMsg as ParentToChildMessageReader,
l1ToL2Msg: parentToChildMsg as ParentToChildMessageReader | undefined,
depositStatus: tokenDeposit.status
})

Expand All @@ -138,11 +138,15 @@ const getBatchTransferDepositData = async ({
l1ToL2Msg,
depositStatus
}: {
l1ToL2Msg: ParentToChildMessageReader
l1ToL2Msg: ParentToChildMessageReader | undefined
depositStatus: TxnStatus | undefined
}): Promise<{
value2: Transaction['value2']
}> => {
if (!l1ToL2Msg) {
return { value2: undefined }
}

if (!isPotentialBatchTransfer({ l1ToL2Msg })) {
return { value2: undefined }
}
Expand Down

0 comments on commit 12d058d

Please sign in to comment.