Merge pull request #296 from GinWU05/local

fix: `TypeError: Cannot read properties of undefined (reading 'trim')`
This commit is contained in:
Gabe
2025-08-22 15:38:29 +08:00
committed by GitHub

View File

@@ -467,6 +467,11 @@ export class Translator {
q.length > (this._setting.maxLength ?? TRANS_MAX_LENGTH);
_render = (el) => {
// 检查元素是否有效
if (!el || typeof el.innerText === "undefined") {
return;
}
let traEl = el.querySelector(APP_LCNAME);
// 已翻译