diff --git a/client/src/view.ts b/client/src/view.ts index a1a67e62e5..9555e0a922 100644 --- a/client/src/view.ts +++ b/client/src/view.ts @@ -150,14 +150,13 @@ export default class View extends BullView; - data[this.name] = (this.$element.val() as string).trim(); + data[this.name] = (this.$element?.val() as string).trim(); return data; } @@ -1613,7 +1613,7 @@ export default class BaseFieldView< * Fetch search data from DOM. */ fetchSearch(): Record | null { - const value = this.$element.val().toString().trim(); + const value = this.$element?.val()?.toString()?.trim(); if (value) { return { diff --git a/tsconfig.json b/tsconfig.json index f7d120d417..4bb9c1bceb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,8 @@ "skipLibCheck": true, "allowJs": true, "checkJs": false, - "noEmit": true + "noEmit": true, + "strictPropertyInitialization": false }, "include": [ "client/src",