Fix Zotero crash if last collection before a separator was deleted

This commit is contained in:
Dan Stillman 2011-03-04 07:39:35 +00:00
parent a6b8633f2e
commit e82a56bb4c

View file

@ -868,11 +868,17 @@ Zotero.CollectionTreeView.prototype.deleteSelection = function()
} }
this._treebox.endUpdateBatch(); this._treebox.endUpdateBatch();
if(end.value < this.rowCount) if (end.value < this.rowCount) {
var row = this._getItemAtRow(end.value);
if (row.isSeparator()) {
return;
}
this.selection.select(end.value); this.selection.select(end.value);
else }
else {
this.selection.select(this.rowCount-1); this.selection.select(this.rowCount-1);
} }
}
/* /*
* Called by various view functions to show a row * Called by various view functions to show a row