Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'removeListener' of null #900

Closed
dcposch opened this issue Sep 4, 2016 · 2 comments
Closed

Cannot read property 'removeListener' of null #900

dcposch opened this issue Sep 4, 2016 · 2 comments

Comments

@dcposch
Copy link
Contributor

@dcposch dcposch commented Sep 4, 2016

  • WebTorrent version: 0.96.4
  • Node and browser versions: all

Here's a common error from the WebTorrent Desktop telemetry: webtorrent/webtorrent-desktop#890

In lib/server.js:

  server.close = function (cb) {
    closed = true
    torrent = null
    server.removeListener('connection', onConnection)
    server.removeListener('request', onRequest)
    while (pendingReady.length) {
      var onReady = pendingReady.pop()
      torrent.removeListener('ready', onReady)
    }
    _close.call(server, cb)
  }

The call to torrent.removeListener will always fail, right?

We should set torrent = null only at the very end.

@feross

@feross feross closed this in 6980752 Sep 13, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Sep 14, 2016

LOL, how did this even get into master? We're testing the server functionality. Maybe we only call destroy() and not close()?

Fix is in 0.96.5

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.