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

server.destroy() TypeError: callback is not a function #899

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

server.destroy() TypeError: callback is not a function #899

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/browser version: Electron 1.3.3

When calling server.destroy():

TypeError: callback is not a function
nextTick @ internal/process/next_tick.js:142
(anonymous function) @ init.js:22
Server.server.destroy @ server.js:40
stopServer @ webtorrent.js:311
ipc.on.e @ webtorrent.js:76
emitOne @ events.js:96
emit @ events.js:188

Fix

I think server.destroy() should handle the case gracefully where it's called with no arguments.

Workaround

If you don't want a callback, just call

server.destroy(function() {})
@feross feross closed this in 10ab81d Sep 13, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Sep 14, 2016

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.