diff --git a/app/ui.js b/app/ui.js index e4dfd5af8..316042911 100644 --- a/app/ui.js +++ b/app/ui.js @@ -818,13 +818,17 @@ const UI = { disableSetting(name) { const ctrl = document.getElementById('noVNC_setting_' + name); ctrl.disabled = true; - ctrl.label.classList.add('noVNC_disabled'); + if (ctrl.label !== undefined) { + ctrl.label.classList.add('noVNC_disabled'); + } }, enableSetting(name) { const ctrl = document.getElementById('noVNC_setting_' + name); ctrl.disabled = false; - ctrl.label.classList.remove('noVNC_disabled'); + if (ctrl.label !== undefined) { + ctrl.label.classList.remove('noVNC_disabled'); + } }, /* ------^-------