From 172cdb4cec38e996b119a36ee35561ceae9ddd6d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 19 Mar 2007 21:40:06 +0000 Subject: [PATCH] Fix error when deleting attachments --- chrome/content/zotero/xpcom/data_access.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/data_access.js b/chrome/content/zotero/xpcom/data_access.js index 820641db2..6a8faf9bb 100644 --- a/chrome/content/zotero/xpcom/data_access.js +++ b/chrome/content/zotero/xpcom/data_access.js @@ -2101,10 +2101,15 @@ Zotero.Item.prototype.erase = function(deleteChildren){ case Zotero.Attachments.LINK_MODE_LINKED_URL: break; default: - var file = Zotero.getStorageDirectory(); - file.append(this.getID()); - if (file.exists()){ - file.remove(true); + try { + var file = Zotero.getStorageDirectory(); + file.append(this.getID()); + if (file.exists()){ + file.remove(true); + } + } + catch (e) { + Components.utils.reportError(e); } } }