diff options
author | Maxim Devaev <[email protected]> | 2024-11-02 18:48:14 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-11-02 18:48:14 +0200 |
commit | 28167c4b45dc2e6d7d1003cfc1c645b43ba194ea (patch) | |
tree | f6664b0b3a5616dde720d3040d020d98d22e4a7d /web/share/js | |
parent | 5aef0a2193775cfaf3dc05e79edd34418e71885c (diff) |
fixed ocr null event handling
Diffstat (limited to 'web/share/js')
-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"); |