Fix upgrade error "counts[0] is undefined" (or "counts[1]")
This commit is contained in:
parent
505d3e6ac7
commit
551c8a36a7
1 changed files with 6 additions and 2 deletions
|
@ -1725,9 +1725,13 @@ Zotero.Schema = new function(){
|
|||
continue;
|
||||
}
|
||||
|
||||
// Use most frequent
|
||||
var counts = Zotero.DB.query("SELECT tag, COUNT(*) AS numItems FROM tags NATURAL JOIN itemTags WHERE tag LIKE ? GROUP BY tag ORDER BY numItems DESC", l);
|
||||
if (counts[0].numItems != counts[1].numItems) {
|
||||
// If not associated with any items, use all lowercase
|
||||
if (!counts) {
|
||||
var newTag = l;
|
||||
}
|
||||
// Use most frequent
|
||||
else if (counts[0].numItems != counts[1].numItems) {
|
||||
var newTag = counts[0].tag;
|
||||
}
|
||||
// Use earliest
|
||||
|
|
Loading…
Reference in a new issue