diff options
-rw-r--r-- | web/share/js/kvm/ocr.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/share/js/kvm/ocr.js b/web/share/js/kvm/ocr.js index 5f44791a..8dab2741 100644 --- a/web/share/js/kvm/ocr.js +++ b/web/share/js/kvm/ocr.js @@ -73,8 +73,12 @@ export function Ocr(__getGeometry) { /************************************************************************/ self.setState = function(state) { - if (state.enabled !== undefined) { - __enabled = (state.enabled && !tools.browser.is_mobile); + if (state) { + if (state.enabled !== undefined) { + __enabled = (state.enabled && !tools.browser.is_mobile); + } + } else { + __enabled = false; } if (__enabled) { let el = $("stream-ocr-lang-selector"); |