Fix progress window hang if Find Available PDF fails

This commit is contained in:
Dan Stillman 2018-08-10 17:36:04 -04:00
parent 0f1687f1c7
commit 7cf6634764

View file

@ -3874,9 +3874,14 @@ var ZoteroPane = new function()
for (let i = 0; i < items.length; i++) {
let item = items[i];
if (Zotero.Attachments.canFindPDFForItem(item)) {
let attachment = await Zotero.Attachments.addAvailablePDF(item);
if (attachment) {
successful++;
try {
let attachment = await Zotero.Attachments.addAvailablePDF(item);
if (attachment) {
successful++;
}
}
catch (e) {
Zotero.logError(e);
}
}
itemProgress.setProgress(((i + 1) / items.length) * 100);