diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index dd7b5afcc3..2727766708 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -376,6 +376,20 @@ Zotero.Attachments = new function(){ } catch (e) { Zotero.DB.rollbackTransaction(); + + try { + // Clean up + if (itemID) { + var destDir = Zotero.getStorageDirectory(); + destDir.append(itemID); + if (destDir.exists()) { + destDir.remove(true); + } + } + } + catch (e) {} + + throw (e); } Zotero.Fulltext.indexDocument(document, itemID);