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

engine.remove calls destroy too and the callback is now optional #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

giacomocerquone
Copy link
Contributor

Fixed #143
Now the callback is optional and engine.remove() calls automatically engine.destroy.
@mafintosh Sorry for the late fix but the college is destroying me (just to stay on topic), I'm used to use useless semicolon when I call function, but I respected your style here :)

fs.unlink(torrentPath, function (err) {
if (err) return cb(err)
if (err && typeof cb === 'function') return cb(err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If cb is undefined, is it worth continuing? Maybe just initialize cb to a default value? E.g. cb = cb || noop;

@giacomocerquone
Copy link
Contributor Author

Ops you're right, I haven't thought to use an empty function

@giacomocerquone
Copy link
Contributor Author

This is related to the #98 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"cb() is not a function" on engine.remove
2 participants