From 665473b1081fd80a6c170a8d7c0a8ea1e4b48a6c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 11 Jan 2023 02:31:08 -0500 Subject: [PATCH] Add protection against immediate retries in delayGenerator --- chrome/content/zotero/xpcom/utilities_internal.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 4f7a38238f..7831afa025 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -860,7 +860,14 @@ Zotero.Utilities.Internal = { delay = interval; } + // Be safe + if (!delay) { + Zotero.logError(`Incorrect delay ${delay} -- stopping`); + yield Zotero.Promise.resolve(false); + } + if (maxTime && (totalTime + delay) > maxTime) { + Zotero.debug(`Total delay time exceeds ${maxTime} -- stopping`); yield Zotero.Promise.resolve(false); }