From c7da16f07d1f3bb65ce6dc3d150717fe7761852f 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 7fc028f7f6..2ca6335bfa 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -887,7 +887,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); }