From e89de4b41730863856c73c58ca15d38659e9a482 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 11 Jul 2008 09:18:03 +0000 Subject: [PATCH] fixes #1062, Zotero RDF import/export problems with empty collections not sure if 3B is fixed (feel free to re-open if it isn't), but 1, 2, and 3A should now be resolved --- chrome/content/zotero/xpcom/translate.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 246e86aa7..a8612ea8e 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -1764,6 +1764,9 @@ Zotero.Translate.prototype._export = function() { } else if(this.collection) { // get items in this collection this._itemsLeft = this.collection.getChildItems(); + if(!this._itemsLeft) { + this._itemsLeft = []; + } if(this.configOptions.getCollections) { // get child collections @@ -1776,7 +1779,10 @@ Zotero.Translate.prototype._export = function() { // get items in child collections for each(var collection in this._collectionsLeft) { - this._itemsLeft = this._itemsLeft.concat(collection.getChildItems()); + var childItems = collection.getChildItems(); + if(childItems) { + this._itemsLeft = this._itemsLeft.concat(childItems); + } } } } else {