fx-compat: Style Editor: Fix error when no style selected
This commit is contained in:
parent
52e8fa8995
commit
7829a0dfdc
1 changed files with 2 additions and 1 deletions
|
@ -148,7 +148,8 @@ var Zotero_CSL_Editor = new function() {
|
||||||
this.onStyleModified = function () {
|
this.onStyleModified = function () {
|
||||||
let xml = editor.getValue();
|
let xml = editor.getValue();
|
||||||
let cslList = document.getElementById('zotero-csl-list');
|
let cslList = document.getElementById('zotero-csl-list');
|
||||||
if (xml !== Zotero.Styles.get(cslList.value)?.getXML()) {
|
let savedStyle = Zotero.Styles.get(cslList.value);
|
||||||
|
if (!savedStyle || xml !== savedStyle?.getXML()) {
|
||||||
cslList.selectedIndex = -1;
|
cslList.selectedIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue