Skip to content

Commit

Permalink
Merge pull request #6 from lfreneda/null-reference
Browse files Browse the repository at this point in the history
set an empty string when string was not provided
  • Loading branch information
nepsilon authored Sep 1, 2016
2 parents 48066a1 + 1efb5b1 commit fc2d1e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/search-query-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, ' ');
Expand Down

0 comments on commit fc2d1e1

Please sign in to comment.