Fix error in doc prefs window if lastStyle is set to an invalid style

This commit is contained in:
Dan Stillman 2008-10-24 21:08:44 +00:00
parent 7a2d7594d4
commit 56eb416e3e

View file

@ -62,6 +62,7 @@ var Zotero_File_Interface_Bibliography = new function() {
// add styles to list
var index = 0;
var nStyles = styles.length;
var selectIndex = -1;
for(var i=0; i<nStyles; i++) {
var itemNode = document.createElement("listitem");
itemNode.setAttribute("value", styles[i].styleID);
@ -69,7 +70,7 @@ var Zotero_File_Interface_Bibliography = new function() {
listbox.appendChild(itemNode);
if(styles[i].styleID == _io.style) {
var selectIndex = index;
selectIndex = index;
}
index++;
}