commit 46e3e7293e9e38ed57333081b34e78bf1a5056c2
parent e2ea7532ba0a37b52520b805a9cc6a8b92a235af
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 4 Feb 2013 05:03:12 -0500
Fix "results.sort is not a function" in tags autocomplete
This occured if there were no autocomplete results for an entered tag
string.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/components/zotero-autocomplete.js b/components/zotero-autocomplete.js
@@ -88,6 +88,9 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, p
statement = this._zotero.DB.getStatement(sql, sqlParams);
var resultsCallback = function (results) {
+ if (!results) {
+ return;
+ }
var collation = self._zotero.getLocaleCollation();
results.sort(function(a, b) {
return collation.compareString(1, a.val, b.val);