From 9ea82bb6cd4c15082614e84a1090556da43b4b3b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 3 Mar 2017 16:39:37 -0500 Subject: [PATCH] Fix potential error dragging attachment with missing file --- chrome/content/zotero/xpcom/attachments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 4761318e8c..0f0fab07fe 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1092,7 +1092,7 @@ Zotero.Attachments = new function(){ yield newAttachment.save(); // Copy over files if they exist - if (newAttachment.isImportedAttachment() && attachment.getFile()) { + if (newAttachment.isImportedAttachment() && (yield attachment.fileExists())) { let dir = Zotero.Attachments.getStorageDirectory(attachment); let newDir = yield Zotero.Attachments.createDirectoryForItem(newAttachment); yield Zotero.File.copyDirectory(dir, newDir);