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:
commit
17931698a8
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user