From 621af3b301ca37a55a762f2ed51984f809fbc24f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 28 Jan 2011 22:48:07 +0000 Subject: [PATCH] fix import failure when an attachment has no path or uri --- chrome/content/zotero/xpcom/translation/item_local.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/item_local.js b/chrome/content/zotero/xpcom/translation/item_local.js index 56d230107..bb99f9fcf 100644 --- a/chrome/content/zotero/xpcom/translation/item_local.js +++ b/chrome/content/zotero/xpcom/translation/item_local.js @@ -86,6 +86,7 @@ Zotero.Translate.ItemSaver.prototype = { } else { if(type == "attachment") { // handle attachments differently newItem = this._saveAttachment(item); + if(!newItem) return; var myID = newItem.id; } else { var typeID = Zotero.ItemTypes.getID(type); @@ -357,7 +358,6 @@ Zotero.Translate.ItemSaver.prototype = { } // if field is valid for this type, set field - Zotero.debug("Translate: Testing "+fieldID+" "+typeID); if(fieldID && Zotero.ItemFields.isValidForType(fieldID, typeID)) { newItem.setField(fieldID, item[field]); } else {