X-Git-Url: http://www.average.org/gitweb/?p=pulsecounter.git;a=blobdiff_plain;f=web%2Findex.html;fp=web%2Findex.html;h=a1745afe9684bb469b686fb7c6dad6832a852c42;hp=0c6c1777b3a1870ac20e2ce6fc4f9843fb2e3785;hb=518d7ac2a0b474e133a2803cd8e05a858d12a647;hpb=52f2a01b64c56d1c0e27a411fe524a926b59c398 diff --git a/web/index.html b/web/index.html index 0c6c177..a1745af 100644 --- a/web/index.html +++ b/web/index.html @@ -241,10 +241,14 @@ document.getElementById("curhot").innerHTML = (data.current.hot / 100).toFixed(2); - document.getElementById("totcold").innerHTML = - ((data.cold[data.cold.length - 1][1] - data.cold[0][1]) * 10); - document.getElementById("tothot").innerHTML = - ((data.hot[data.hot.length - 1][1] - data.hot[0][1]) * 10); + if (data.cold.length) + document.getElementById("totcold").innerHTML = + ((data.cold[data.cold.length - 1][1] - data.cold[0][1]) * 10); + else document.getElementById("totcold").innerHTML = "0"; + if (data.hot.length) + document.getElementById("tothot").innerHTML = + ((data.hot[data.hot.length - 1][1] - data.hot[0][1]) * 10); + else document.getElementById("tothot").innerHTML = "0"; tmin = data.range.lo; tmax = data.range.hi;