Test for existence of monitors[i] before trying to kill it just to reduce javascript errors

pull/3588/head
Isaac Connor 2022-08-09 18:52:31 -04:00 committed by Isaac Connor
parent 4b5db75d90
commit 3c38f5d3f9
1 changed files with 2 additions and 2 deletions

View File

@ -265,8 +265,8 @@ function initPage() {
// If you click on the navigation links, shut down streaming so the browser can process it
document.querySelectorAll('#main-header-nav a').forEach(function(el) {
el.onclick = function() {
for (var i = 0, length = monitors.length; i < length; i++) {
monitors[i].kill();
for (let i = 0, length = monitors.length; i < length; i++) {
if (monitors[i]) monitors[i].kill();
}
};
});