mirror of
https://github.com/zotero/zotero.git
synced 2026-10-11 03:38:25 +00:00
Style configurator: Log error and discard invalid locale values
This commit is contained in:
parent
c76371aeed
commit
a4e0eaaba4
1 changed files with 9 additions and 0 deletions
|
|
@ -107,6 +107,15 @@
|
|||
}
|
||||
|
||||
set value(val) {
|
||||
try {
|
||||
// eslint-disable-next-line no-new
|
||||
new Intl.Locale(val);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
val = '';
|
||||
}
|
||||
|
||||
this._value = val;
|
||||
const styleData = this._style ? Zotero.Styles.get(this._style) : null;
|
||||
this.localeListEl.value = styleData && styleData.locale || this._value;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue