www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 4eb18e5eba97aa53ee91b2edd98f95bfb9fa188b
parent f75d7313dd3957ca35c05d367ce608eb3c9d5d06
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 30 Sep 2017 23:45:00 -0400

Make missing row in itemTreeView::getSelectedItems() non-fatal

This might help avoid the search bar brokenness that people are seeing
(and that we can't reproduce), though the same problem might just cause
a later error.

Diffstat:
Mchrome/content/zotero/xpcom/itemTreeView.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -1979,12 +1979,12 @@ Zotero.ItemTreeView.prototype.getSelectedItems = function(asIDs) { this.selection.getRangeAt(i,start,end); for (var j=start.value; j<=end.value; j++) { - if (asIDs) { - items.push(this.getRow(j).id); - } - else { - items.push(this.getRow(j).ref); + let row = this.getRow(j); + if (!row) { + Zotero.logError(`Row ${j} not found`); + continue; } + items.push(asIDs ? row.id : row.ref); } } return items;