Skip to content

Commit 150eb94

Browse files
committed
guard font checked test
1 parent 7fbe376 commit 150eb94

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎mathfont-table.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ function updateURL () {
6767
if(typeof minwin == 'object') newl=newl+"w=" + minwin.value + "&";
6868
newl=newl+"f=,";
6969
for (let value in mathfont_list) {
70-
newl=newl +(document.getElementById("select"+value).checked ? fontShort(value)+"," :"");
70+
let inp = document.getElementById("select"+value);
71+
newl=newl +(inp && inp.checked ? fontShort(value)+"," :"");
7172
}
7273
const l= document.getElementById("ltxedit");
7374
const am = document.getElementById("asciimathedit");
@@ -90,7 +91,8 @@ function updateCookies () {
9091
if(typeof minwin == 'object') createCookie("mathfonts-width",minwin.value);
9192
let f=",";
9293
for (let value in mathfont_list) {
93-
if(document.getElementById("select"+value).checked)f=f + fontShort(value)+",";
94+
let inp = document.getElementById("select"+value);
95+
if(inp && inp.checked)f=f + fontShort(value)+",";
9496
}
9597
createCookie("mathfonts-fonts",f);
9698
const l= document.getElementById("ltxedit");

0 commit comments

Comments
 (0)