From 27389fc71ed28334a4f2134eb3a88bd6d8f82900 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Mon, 21 Jun 2021 09:28:35 -0500 Subject: [PATCH] fix unsafe destructuring instance (#11351) --- ui/ducks/confirm-transaction/confirm-transaction.duck.js | 4 +--- ui/selectors/confirm-transaction.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ui/ducks/confirm-transaction/confirm-transaction.duck.js b/ui/ducks/confirm-transaction/confirm-transaction.duck.js index c02af582a..b0dfd5636 100644 --- a/ui/ducks/confirm-transaction/confirm-transaction.duck.js +++ b/ui/ducks/confirm-transaction/confirm-transaction.duck.js @@ -203,9 +203,7 @@ export function updateTxDataAndCalculate(txData) { // if the gas price from our infura endpoint is null or undefined // use the metaswap average price estimation as a fallback - let { - txParams: { gasPrice }, - } = txData; + let { txParams: { gasPrice } = {} } = txData; if (!gasPrice) { gasPrice = getAveragePriceEstimateInHexWEI(state) || '0x0'; } diff --git a/ui/selectors/confirm-transaction.js b/ui/selectors/confirm-transaction.js index 8c8abc4e3..101e522d4 100644 --- a/ui/selectors/confirm-transaction.js +++ b/ui/selectors/confirm-transaction.js @@ -223,9 +223,7 @@ export const transactionFeeSelector = function (state, txData) { // if the gas price from our infura endpoint is null or undefined // use the metaswap average price estimation as a fallback - let { - txParams: { gasPrice }, - } = txData; + let { txParams: { gasPrice } = {} } = txData; if (!gasPrice) { gasPrice = getAveragePriceEstimateInHexWEI(state) || '0x0'; }