Closed gambhiro closed 11 years ago
Good catch and thanks for reporting this bug! I'd be happy to accept a pull request with a fix for this issue.
You don't need to change the 'built' version of the library, just the individual files, in this case just lib/tokenizer.js
.
Also, include a simple test to prevent any regressions of this bug in the future, you should add your test to test/tokenizer_test.js
.
Lastly, it might be a little more idiomatic JavaScript to change your modification to be like the following:
if (!str) return []
Let me know if you don't feel comfortable with contributing a patch and I'll put together a fix.
Interesting excercise for a one-line fix :) Thanks for the mini-tutorial too.
I've pushed a new version, 0.3.2, which includes a fix for this issue.
Great, thanks!
I got
TypeError: Cannot call method 'replace' of null
for line 74 inlunr.js
.Just inserting a check for null argument fixes it: