diff --git a/src/renderer/components/input/input.tsx b/src/renderer/components/input/input.tsx index e5276ffcb5..f9054ceeb8 100644 --- a/src/renderer/components/input/input.tsx +++ b/src/renderer/components/input/input.tsx @@ -91,7 +91,7 @@ const defaultProps: Partial = { export class Input extends React.Component { static defaultProps = defaultProps as object; - public input: InputElement; + public input: InputElement | null = null; public validators: InputValidator[] = []; public state: State = { @@ -191,7 +191,7 @@ export class Input extends React.Component { } } - this.input.setCustomValidity(errors.length ? errors[0].toString() : ""); + this.input?.setCustomValidity(errors.length ? errors[0].toString() : ""); } setValidation(errors: React.ReactNode[]) {