coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.72k stars 239 forks source link

Don't index a field if it is null or blank #196

Open JordanReiter opened 7 years ago

JordanReiter commented 7 years ago

Currently if the value for a field is null, attempting to index the field throws an error:

Uncaught TypeError: Cannot read property 'toLowerCase' of null
    at searchTokenizer

This fix ignores a field if it is null or empty.