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

Pipeline functions returning null does not discard token #422

Closed
StephenCleary opened this issue Oct 22, 2019 · 4 comments
Closed

Pipeline functions returning null does not discard token #422

StephenCleary opened this issue Oct 22, 2019 · 4 comments

Comments

@StephenCleary
Copy link

The documentation states "A pipeline function can indicate that the passed token should be discarded by returning null. This token will not be passed to any downstream pipeline functions and will not be added to the index."

However, the code checks for undefined or empty string, and will pass null tokens through to the next pipeline function.

@hoelzro
Copy link
Contributor

hoelzro commented Oct 22, 2019

Can confirm via fiddle

The documentation for the module itself implies that undefined is indeed the right value to return, and there's a test that backs this up

@hoelzro
Copy link
Contributor

hoelzro commented Oct 22, 2019

I've submitted a PR to address this: #423

@olivernn
Copy link
Owner

I think the right fix here is to treat a null in the same way the code currently treats undefined and ""

@hoelzro thanks for the pull request, but I think we can take this opportunity to make the code match the documentation! I'll put together a change with a fix just now.

@olivernn
Copy link
Owner

I've just pushed 2.3.8 which includes a fix for this issue, thanks for taking the time to report and to @hoelzro for investigating.

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

3 participants