From 35d1299735ab0c6f37400bc60890bb90abb5672a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s?= Date: Sun, 25 Dec 2022 22:15:28 +0100 Subject: [PATCH] Fixed when empty query added as bad query There was an issue when empty query was ran but no result given, the code did not even try to query result when empty search did not give results. --- src/jquery.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } }