From 49812d6efcebe5dd54b1e71ac97e81fdf7536da4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 29 Dec 2025 17:59:03 -0500 Subject: [PATCH] Fix `migrateExtraFields()` when `onProgress` isn't passed --- chrome/content/zotero/xpcom/schema.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index a1b2a2fecd..ca79178b56 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -670,7 +670,7 @@ Zotero.Schema = new function(){ * This needs the data object architecture to be initialized, so it's called from zotero.js * rather than in _updateGlobalSchema(). */ - this.migrateExtraFields = async function ({ onProgress }) { + this.migrateExtraFields = async function ({ onProgress } = {}) { // Check for a flag set by _updateGlobalSchema() var needsUpdate = await Zotero.DB.valueQueryAsync( "SELECT COUNT(*) FROM settings WHERE setting='globalSchema' AND key='migrateExtra'" @@ -721,7 +721,9 @@ Zotero.Schema = new function(){ notifierQueue }); } - onProgress({ progress: ++progress, progressMax }); + if (onProgress) { + onProgress({ progress: ++progress, progressMax }); + } } } finally {