Skip to content

Commit

Permalink
SendFlow/CustomGas: Fix #1473 crash when modifying gas limit if gas p…
Browse files Browse the repository at this point in the history
…rice is empty
  • Loading branch information
EtDu committed May 22, 2020
1 parent c401cf4 commit e7c03ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/components/Views/SendFlow/CustomGas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ class CustomGas extends PureComponent {
onGasLimitChange = value => {
let warningGasLimit;
const { customGasPrice } = this.state;
const gasPrice = customGasPrice === '' ? '0' : customGasPrice;
const bnValue = new BN(value);
if (!value || value === '' || !isDecimal(value)) warningGasLimit = strings('transaction.invalid_gas');
else if (bnValue && !isBN(bnValue)) warningGasLimit = strings('transaction.invalid_gas');
Expand All @@ -404,7 +405,7 @@ class CustomGas extends PureComponent {
this.setState({ customGasLimit: value, customGasLimitBN: bnValue, warningGasLimit });
this.props.handleGasFeeSelection({
gas: bnValue,
gasPrice: apiEstimateModifiedToWEI(customGasPrice),
gasPrice: apiEstimateModifiedToWEI(gasPrice),
error: warningGasLimit
});
};
Expand Down

0 comments on commit e7c03ea

Please sign in to comment.