mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix port stream end bug
Emitting `end` or `close` was not ending the stream. Pushing a null packet also closes a stream, so I did that instead. Fixes #616
This commit is contained in:
parent
b13eaaa0cd
commit
e10c651db0
@ -30,8 +30,7 @@ PortDuplexStream.prototype._onMessage = function (msg) {
|
|||||||
|
|
||||||
PortDuplexStream.prototype._onDisconnect = function () {
|
PortDuplexStream.prototype._onDisconnect = function () {
|
||||||
try {
|
try {
|
||||||
// this.end()
|
this.push(null)
|
||||||
this.emit('close')
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.emit('error', err)
|
this.emit('error', err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user