diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js index f06525a097..dc813dab96 100644 --- a/chrome/content/zotero/selectItemsDialog.js +++ b/chrome/content/zotero/selectItemsDialog.js @@ -93,12 +93,12 @@ function doUnload() } var onCollectionSelected = async function () { + var collectionTreeRow = collectionsView.getRow(collectionsView.selection.focused); if (!collectionsView.selection.count) return; // Collection not changed if (itemsView && itemsView.collectionTreeRow && itemsView.collectionTreeRow.id == collectionTreeRow.id) { return; } - var collectionTreeRow = collectionsView.getRow(collectionsView.selection.focused); collectionTreeRow.setSearch(''); Zotero.Prefs.set('lastViewedFolder', collectionTreeRow.id);