diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index b99146c..ed922f8 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -819,7 +819,7 @@ // Cache results if cache is not disabled: if (!options.noCache) { that.cachedResponse[cacheKey] = result; - if (options.preventBadQueries && !result.suggestions.length) { + if (options.preventBadQueries && !result.suggestions.length && originalQuery) { that.badQueries.push(originalQuery); } }