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:
parent
8a7f3645bc
commit
6dcc70f531
1 changed files with 3 additions and 0 deletions
|
@ -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}`,
|
||||
|
|
Loading…
Reference in a new issue