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.
This commit is contained in:
Abe Jellinek 2023-07-29 22:28:10 -04:00
parent 8a7f3645bc
commit 6dcc70f531

View file

@ -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}`,