1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Merge pull request #3892 from alextsg/gh-3891

Fix populating txParams with undefined data
This commit is contained in:
kumavis 2018-04-05 15:02:35 -07:00 committed by GitHub
commit 17931698a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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)
}

View File

@ -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