Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
relax null values check (#1248)
Browse files Browse the repository at this point in the history
Co-authored-by: Leandro Boscariol <alfetopito@users.noreply.github.com>
  • Loading branch information
Velenir and alfetopito authored Jul 21, 2020
1 parent 01a9a98 commit 8e4fa12
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/components/TradeWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -868,15 +868,7 @@ const TradeWidget: React.FC = () => {
const cachedSellToken = getToken('symbol', sellToken.symbol, tokens)

// Do not let potential null values through
if (
!buyAmount ||
buyAmount.isZero() ||
!sellAmount ||
sellAmount.isZero() ||
!cachedBuyToken ||
!cachedSellToken ||
!networkId
) {
if (!buyAmount || buyAmount.isZero() || !sellAmount || sellAmount.isZero() || !cachedBuyToken || !cachedSellToken) {
logDebug(
`Preventing null values on submit:
buyAmount:${buyAmount}, sellAmount:${sellAmount},
Expand All @@ -894,7 +886,7 @@ const TradeWidget: React.FC = () => {
sellToken: cachedSellToken,
buyToken: cachedBuyToken,
}
if (isConnected && userAddress) {
if (isConnected && userAddress && networkId) {
await _placeOrder({
...orderParams,
networkId,
Expand Down

0 comments on commit 8e4fa12

Please sign in to comment.