From 2c014a9af1160d4a192eb89a24466009225a3edf Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 31 Oct 2016 02:28:02 -0400 Subject: [PATCH] Debugging for https://forums.zotero.org/discussion/62942/ --- chrome/content/zotero/xpcom/data/item.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index c0020b3fd..d0d83e95e 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -4231,7 +4231,11 @@ Zotero.Item.prototype.toJSON = function (options = {}) { // Collections if (this.isTopLevelItem()) { obj.collections = this.getCollections().map(function (id) { - return this.ContainerObjectsClass.getLibraryAndKeyFromID(id).key; + var { libraryID, key } = this.ContainerObjectsClass.getLibraryAndKeyFromID(id); + if (!key) { + throw new Error("Item collection " + id + " not found"); + } + return key; }.bind(this)); }