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