Fix innocuous error installing a style

Installing a style could throw an error if the preferences were open and the
styles pane had not yet been selected, although the style would be
successfully installed.

See https://forums.zotero.org/discussion/29250/importing-a-new-style/
This commit is contained in:
Simon Kornblith 2013-05-02 14:46:35 -04:00
parent 01fd28b99f
commit 2a33ede284

View file

@ -382,7 +382,9 @@ Zotero.Styles = new function() {
var enumerator = wm.getEnumerator("zotero:pref"); var enumerator = wm.getEnumerator("zotero:pref");
while(enumerator.hasMoreElements()) { while(enumerator.hasMoreElements()) {
var win = enumerator.getNext(); var win = enumerator.getNext();
win.Zotero_Preferences.Cite.refreshStylesList(styleID); if(win.Zotero_Preferences.Cite) {
win.Zotero_Preferences.Cite.refreshStylesList(styleID);
}
} }
}); });
} }