Fix "results.sort is not a function" in tags autocomplete

This occured if there were no autocomplete results for an entered tag
string.
This commit is contained in:
Dan Stillman 2013-02-04 05:03:12 -05:00
parent e2ea7532ba
commit 46e3e7293e

View file

@ -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);