diff --git a/lib/search-query-parser.js b/lib/search-query-parser.js index ceadc3f..278b7fe 100644 --- a/lib/search-query-parser.js +++ b/lib/search-query-parser.js @@ -11,6 +11,10 @@ exports.parse = function (string, options) { options = {}; } + if (!string) { + string = ''; + } + // Regularize white spacing // Make in-between white spaces a unique space string = string.trim().replace(/\s+/g, ' ');