From 9c516cbde4198b5b1bcd914fb372fd5e4a9601df Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 20 Sep 2021 09:54:12 -0400 Subject: [PATCH] Fix error due to async validators for (#3823) Signed-off-by: Sebastian Malton --- src/renderer/components/input/input.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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[]) {