summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-11-02 18:48:14 +0200
committerMaxim Devaev <[email protected]>2024-11-02 18:48:14 +0200
commit28167c4b45dc2e6d7d1003cfc1c645b43ba194ea (patch)
treef6664b0b3a5616dde720d3040d020d98d22e4a7d
parent5aef0a2193775cfaf3dc05e79edd34418e71885c (diff)
fixed ocr null event handling
-rw-r--r--web/share/js/kvm/ocr.js8
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");