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:
parent
e2ea7532ba
commit
46e3e7293e
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue