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

Small fix for null parent #10

Closed
wants to merge 2 commits into from
Closed

Conversation

josepaiva94
Copy link

I had to add a null check because sometimes a null parent here raises an exception in Mosca

I had to add a null check because sometimes a null parent here raises an exception in Mosca
@coveralls
Copy link

coveralls commented Mar 31, 2017

Coverage Status

Coverage increased (+0.009%) to 96.588% when pulling 5b1e163 on josepaiva94:master into 61a3382 on mcollina:master.

@mcollina
Copy link
Owner

Can you please add a unit test?

I had to add a null check because sometimes a null parent here raises an exception in Mosca
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 96.692% when pulling 32309b7 on josepaiva94:master into 61a3382 on mcollina:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 96.692% when pulling 32309b7 on josepaiva94:master into 61a3382 on mcollina:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 96.692% when pulling 32309b7 on josepaiva94:master into 61a3382 on mcollina:master.

@josepaiva94
Copy link
Author

Done ;)

@mcollina
Copy link
Owner

Just to clarify, you should not do this. This library is fast, and it is clearly written in the caveats, the callback must be called only once. It is built to iterate over things, so use it twice:

instance(obj, something, args, released)

function something (nums, cb) {
  instance(obj, function(num, cb) {
       setImmediate(cb, null, num * 2)
   }, nums, cb)
 }

@mcollina mcollina closed this Mar 31, 2017
@josepaiva94
Copy link
Author

Thanks! With your hint I've found that I forgot a return after calling the callback function.

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.

None yet

3 participants