diff --git a/js/ui/profileModal/ProfileHashtagController.js b/js/ui/profileModal/ProfileHashtagController.js index d5d5eec2..be8e8b7b 100644 --- a/js/ui/profileModal/ProfileHashtagController.js +++ b/js/ui/profileModal/ProfileHashtagController.js @@ -185,10 +185,10 @@ export class ProfileHashtagController { } clearHashtagInputs() { - if (this.hashtagInterestInput instanceof HTMLInputElement) { + if (this.hashtagInterestInput && typeof this.hashtagInterestInput.value === "string") { this.hashtagInterestInput.value = ""; } - if (this.hashtagDisinterestInput instanceof HTMLInputElement) { + if (this.hashtagDisinterestInput && typeof this.hashtagDisinterestInput.value === "string") { this.hashtagDisinterestInput.value = ""; } } @@ -385,10 +385,10 @@ export class ProfileHashtagController { : this.hashtagDisinterestInput; const rawValue = - input instanceof HTMLInputElement ? input.value || "" : ""; + input && typeof input.value === "string" ? input.value || "" : ""; const normalized = this.normalizeHashtagTag(rawValue); - if (!(input instanceof HTMLInputElement)) { + if (!(input && typeof input.value === "string")) { return { success: false, reason: "missing-input" }; } diff --git a/repro.mjs b/repro.mjs deleted file mode 100644 index 7a23d05f..00000000 --- a/repro.mjs +++ /dev/null @@ -1,19 +0,0 @@ -class Helper { - constructor() { - this.prop = null; - } -} - -class Controller { - constructor() { - this.helper = new Helper(); - } - get prop() { return this.helper.prop; } -} - -const c = new Controller(); -try { - c.prop.value = 'test'; -} catch (e) { - console.log('Error:', e.message); -} diff --git a/repro_undefined.mjs b/repro_undefined.mjs deleted file mode 100644 index bd807fd1..00000000 --- a/repro_undefined.mjs +++ /dev/null @@ -1,19 +0,0 @@ -class Helper { - constructor() { - // prop not defined - } -} - -class Controller { - constructor() { - this.helper = new Helper(); - } - get prop() { return this.helper.prop; } -} - -const c = new Controller(); -try { - c.prop.value = 'test'; -} catch (e) { - console.log('Error:', e.message); -}