From cfbb3d3d4717347e407fca0f7547ce99317f8842 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 11 Jun 2018 12:16:09 -0400 Subject: [PATCH] Mendeley import: Fix "Collection undefined not found" error If a folder appeared in the DocumentFolders table but not in Folders/RemoteFolders, it caused an error. --- chrome/content/zotero/import/mendeley/mendeleyImport.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index 4f739c6a2..c7b56f082 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -428,7 +428,12 @@ Zotero_Import_Mendeley.prototype._getDocumentCollections = async function (group for (let row of rows) { let keys = map.get(row.documentId); if (!keys) keys = []; - keys.push(folderKeys.get(row.folderId)); + let key = folderKeys.get(row.folderId); + if (!key) { + Zotero.debug(`Document folder ${row.folderId} not found -- skipping`, 2); + continue; + } + keys.push(key); map.set(row.documentId, keys); } return map;