From 94795095f2f32bde9dfa44410c6c102cc757baf1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 20 Jun 2019 18:16:22 -0400 Subject: [PATCH] Fix potential error on retracted item modification If a retracted item was in the trash at startup or when detected and there were no other retracted items in the library, an error would occur if the item was modified. --- chrome/content/zotero/xpcom/retractions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/retractions.js b/chrome/content/zotero/xpcom/retractions.js index 23785bfe12..94fc9cf20c 100644 --- a/chrome/content/zotero/xpcom/retractions.js +++ b/chrome/content/zotero/xpcom/retractions.js @@ -234,6 +234,10 @@ Zotero.Retractions = { }, _removeLibraryRetractedItem: async function (libraryID, itemID) { + // Might not exist if retracted item was in trash at startup or when detected + if (!this._retractedItemsByLibrary[libraryID]) { + return; + } this._retractedItemsByLibrary[libraryID].delete(itemID); await this._updateLibraryRetractions(libraryID); },