Skip to content

Commit b12bcb9

Browse files
authored
fix dapp crash from undefined (#1571)
1 parent 066e740 commit b12bcb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dapp-oeth/src/hooks/useCurrencySwapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import { useWeb3React } from '@web3-react/core'
1717
import addresses from 'constants/contractAddresses'
1818
import curveRoutes from 'constants/curveRoutes'
19-
19+
import { get } from 'lodash'
2020
import { calculateSwapAmounts } from 'utils/math'
2121

2222
const useCurrencySwapper = ({
@@ -140,7 +140,7 @@ const useCurrencySwapper = ({
140140
}
141141

142142
const allowance = parseFloat(
143-
allowances[coinNeedingApproval][allowanceCheckKey]
143+
get(allowances, 'coinNeedingApproval[allowanceCheckKey]')
144144
)
145145

146146
setNeedsApproval(

0 commit comments

Comments
 (0)