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

Calling done() without a function #7

Closed
compressed opened this issue Jun 11, 2013 · 1 comment
Closed

Calling done() without a function #7

compressed opened this issue Jun 11, 2013 · 1 comment

Comments

@compressed
Copy link

Hi,
I was running into an issue today with the following exception:

TypeError: undefined is not a function
    at /var/www/.../node_modules/redis-lock/index.js:75:6

which seems to be for the call to done(). In my code, I have something like:

lock('abc', function (done) {
  ...
  done()
}

That logic in index.js from 71-76 I think needs to check if done is defined or not before using it. Most of the time it may not matter because lockTimeoutValue is generally in the future so the else condition never gets triggered, but when it does, then you'll wind up with the undefined exception.

Does that make sense or am I missing something?

@compressed
Copy link
Author

Thanks!

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

No branches or pull requests

1 participant