From c62f04806d44e7597bb98c841258979fcb1f9e6a Mon Sep 17 00:00:00 2001 From: itcatplayit Date: Sun, 21 May 2023 10:10:46 +0800 Subject: [PATCH] fix: Cannot read properties of null (reading 'style') bug --- src/chrome/content-script.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chrome/content-script.cjs b/src/chrome/content-script.cjs index 237d60e..79b4167 100644 --- a/src/chrome/content-script.cjs +++ b/src/chrome/content-script.cjs @@ -234,7 +234,7 @@ window.addEventListener("message", (event) => { container.append(div) } } - text.style.display = trans ? 'block' : 'none' + text && (text.style.display = trans ? 'block' : 'none') } }, false);