diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 208fc55d0b..796be2e6fd 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2837,7 +2837,20 @@ Zotero.Item.prototype.getFile = function(row, skipExistsCheck) { if (self.isTopLevelItem()) { return; } - Zotero.Items.get(self.getSource()).updateBestAttachmentState(); + + try { + var parentKey = self.getSource(); + } + // This can happen during classic sync conflict resolution, if a + // standalone attachment was modified locally and remotely was changed + // into a child attachment + catch (e) { + Zotero.debug("Attachment parent doesn't exist for source key " + + "in Zotero.Item.updateAttachmentStates()", 1); + return; + } + + Zotero.Items.get(parentKey).updateBestAttachmentState(); }; // No associated files for linked URLs