From 28167c4b45dc2e6d7d1003cfc1c645b43ba194ea Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sat, 2 Nov 2024 18:48:14 +0200 Subject: fixed ocr null event handling --- web/share/js/kvm/ocr.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'web') 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"); -- cgit v1.2.3