From caaa70f6302b0d84d43ca93ab014e0cf37886c0a Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Sun, 11 Mar 2018 12:33:34 +0100
Subject: Fix getTokenBalanceAndAllowanceAsync to take ownerAddressIfExists so
 that we don't sometimes pass an empty string and sometimes undefined

---
 packages/website/ts/components/generate_order/generate_order_form.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'packages/website/ts/components/generate_order/generate_order_form.tsx')

diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx
index 26fa904fe..ea1d57a7b 100644
--- a/packages/website/ts/components/generate_order/generate_order_form.tsx
+++ b/packages/website/ts/components/generate_order/generate_order_form.tsx
@@ -237,8 +237,9 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
 
         // Check if all required inputs were supplied
         const debitToken = this.props.sideToAssetToken[Side.Deposit];
+        const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress;
         const [debitBalance, debitAllowance] = await this.props.blockchain.getTokenBalanceAndAllowanceAsync(
-            this.props.userAddress,
+            userAddressIfExists,
             debitToken.address,
         );
         const receiveAmount = this.props.sideToAssetToken[Side.Receive].amount;
-- 
cgit v1.2.3

