Fix migrateExtraFields() when onProgress isn't passed

This commit is contained in:
Dan Stillman 2025-12-29 17:59:03 -05:00
parent d0182e1ef4
commit 49812d6efc

View file

@ -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 {