From 6dcc70f531f368a0bb2c0ae97d4c23753aa3e7dd Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Sat, 29 Jul 2023 22:28:10 -0400 Subject: [PATCH] Zotero.PreferencePanes.register: Set default values for scripts/stylesheets Without this, the calls to .map() below throw when one or both of those options aren't set. --- chrome/content/zotero/xpcom/preferencePanes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/preferencePanes.js b/chrome/content/zotero/xpcom/preferencePanes.js index a695a77de7..8d1c5920fa 100644 --- a/chrome/content/zotero/xpcom/preferencePanes.js +++ b/chrome/content/zotero/xpcom/preferencePanes.js @@ -119,6 +119,9 @@ Zotero.PreferencePanes = { || this.pluginPanes.some(p => p.id === options.id))) { throw new Error(`Pane with ID ${options.id} already registered`); } + + options.scripts ||= []; + options.stylesheets ||= []; let addPaneOptions = { id: options.id || `plugin-pane-${Zotero.Utilities.randomString()}-${options.pluginID}`,