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.
This commit is contained in:
Dan Stillman 2019-06-20 18:16:22 -04:00
parent c1ab361c92
commit 94795095f2

View file

@ -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);
},