Skip to content

Commit

Permalink
Add text length check to isTextLookupWorthy
Browse files Browse the repository at this point in the history
<rikaitan.link>ZTJmZDNhN2M1MDkwNzQ3OTc5NjYyZTIxZWJlMGU1NzVhMmQ0ZjlkYQo=</rikaitan.link>
  • Loading branch information
jamesmaa committed Jun 4, 2024
1 parent f3cc8ec commit a9908dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/js/language/text-scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a9908dc

Please sign in to comment.