diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-04-06 06:02:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 06:02:35 +0800 |
commit | 17931698a8bb2be77ea9671708135bba79ad2296 (patch) | |
tree | 65b9efe161fe27fe9d536b3abe5aafcb15b13748 | |
parent | 50c36074fb94d0a3de53d32a5aee35f573162397 (diff) | |
parent | 418926ffdfabe8aaefbba5abbf44ebbfd838bbfc (diff) | |
download | tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar.gz tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar.bz2 tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar.lz tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar.xz tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.tar.zst tangerine-wallet-browser-17931698a8bb2be77ea9671708135bba79ad2296.zip |
Merge pull request #3892 from alextsg/gh-3891
Fix populating txParams with undefined data
-rw-r--r-- | app/scripts/lib/tx-state-manager.js | 4 | ||||
-rw-r--r-- | ui/app/send-v2.js | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js index 2ab24d6a0..d8ea17400 100644 --- a/app/scripts/lib/tx-state-manager.js +++ b/app/scripts/lib/tx-state-manager.js @@ -108,6 +108,10 @@ module.exports = class TransactionStateManager extends EventEmitter { updateTx (txMeta, note) { // validate txParams if (txMeta.txParams) { + if (typeof txMeta.txParams.data === 'undefined') { + delete txMeta.txParams.data + } + this.validateTxParams(txMeta.txParams) } diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js index c3b81da5b..094743ff0 100644 --- a/ui/app/send-v2.js +++ b/ui/app/send-v2.js @@ -576,12 +576,17 @@ SendTransactionScreen.prototype.getEditedTx = function () { data, }) } else { - const data = unapprovedTxs[editingTransactionId].txParams.data + const { data } = unapprovedTxs[editingTransactionId].txParams + Object.assign(editingTx.txParams, { value: ethUtil.addHexPrefix(amount), to: ethUtil.addHexPrefix(to), data, }) + + if (typeof editingTx.txParams.data === 'undefined') { + delete editingTx.txParams.data + } } return editingTx |