mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #617 from MetaMask/i616-FixListenerLeak
I616 fix listener leak
This commit is contained in:
commit
54425f4ee7
@ -4,6 +4,7 @@
|
||||
|
||||
- On fresh install, open a new tab with the MetaMask Introduction video.
|
||||
- Block negative values from transactions.
|
||||
- Fixed a memory leak.
|
||||
|
||||
## 2.10.2 2016-09-02
|
||||
|
||||
|
@ -86,6 +86,7 @@ function setupControllerConnection (stream) {
|
||||
stream.pipe(dnode).pipe(stream)
|
||||
dnode.on('remote', (remote) => {
|
||||
// push updates to popup
|
||||
controller.ethStore.removeListener('update', controller.sendUpdate.bind(controller))
|
||||
controller.ethStore.on('update', controller.sendUpdate.bind(controller))
|
||||
controller.listeners.push(remote)
|
||||
idStore.on('update', controller.sendUpdate.bind(controller))
|
||||
|
@ -220,7 +220,7 @@ module.exports = class MetamaskController {
|
||||
}
|
||||
|
||||
enforceTxValidations (txParams) {
|
||||
if (txParams.value.indexOf('-') === 0) {
|
||||
if (('value' in txParams) && txParams.value.indexOf('-') === 0) {
|
||||
const msg = `Invalid transaction value of ${txParams.value} not a positive number.`
|
||||
return new Error(msg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user