Fix JS Type Check error (v2)

This commit is contained in:
bb2
2026-05-23 21:26:45 +08:00
committed by GitHub
parent d16501f1f3
commit 877fb3c50c

View File

@@ -42,7 +42,7 @@ export class UrlTextHandler {
// Only encode the URL if the entire text is selected. // Only encode the URL if the entire text is selected.
if (this._element) { if (this._element) {
this._element.addEventListener("copy", (event) => { this._element.addEventListener("copy", (event) => {
const selectedText = window.getSelection().toString(); const selectedText = window.getSelection()?.toString();
const totalText = this._element.value; const totalText = this._element.value;
// Check if the selected text length matches the total text length. // Check if the selected text length matches the total text length.