Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue when one of the selector is null
When one of the selector is null, the next callback was not called => xray would then never call the fn function. Here, if the selector v is null (or undefined or other, basically, not string/function/array), the function just calls the next callback anyway.
- Loading branch information
e7318d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dfdeagle47 the case where
v
is a function actually doesn't return within its if block, so it falls out and callsnext()
at the end of this function which causes some other problems. Can you verify that this wasn't intentional? I'm catching this in https://github.com/lapwinglabs/x-ray/tree/bugfix/nested-crawling but don't want to merge if it's going to re-break something you already fixede7318d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just saw your message...
You're right, I think it's a mistake on my part, it should probably be
The thing is, I haven't used the case where
v
is a function, so I didn't catch it, but I agree with you that it could cause problems ifnext()
is called twice.