commit 0fd0da29039e9127dd930f52446dc904a32b5942
parent 01c80610b469d97b644c419a28a452855547b1d1
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 1 Dec 2014 16:48:11 -0500
Fix "getItemAtRow(...) is undefined" error for some item modifications
Since 67c63a29
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js
@@ -569,11 +569,15 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData)
if (action == 'delete' || action == 'trash' ||
!itemGroup.ref.hasItem(ids[i])) {
let row = this._itemRowMap[ids[i]];
+
// Row might already be gone (e.g. if this is a child and
// 'modify' was sent to parent)
- if (row != undefined) {
- rows.push(row);
+ if (row == undefined) {
+ continue;
}
+
+ rows.push(row);
+
// Remove child items of removed parents
if (this.isContainer(row) && this.isContainerOpen(row)) {
while (++row < this.rowCount && this.getLevel(row) > 0) {