From e2fd3a7c5090747979662e21ebe0e575a2d4f9da Mon Sep 17 00:00:00 2001 From: James Maa Date: Mon, 3 Jun 2024 14:11:42 -0700 Subject: Add text length check to isTextLookupWorthy (#1026) --- ext/js/language/text-scanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 0270a025..aba44644 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -1619,7 +1619,7 @@ export class TextScanner extends EventDispatcher { */ async _isTextLookupWorthy(text) { try { - return this._language !== null && await this._api.isTextLookupWorthy(text, this._language); + return this._language !== null && text.length > 0 && await this._api.isTextLookupWorthy(text, this._language); } catch (e) { return false; } -- cgit v1.2.3