1
0
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:
Dan Finlay 2016-09-13 12:07:29 -07:00
parent b13eaaa0cd
commit e10c651db0

View File

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