From f1f7705228db51db9e3403e389ad3462f6334d62 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Fri, 4 Sep 2020 11:12:47 +0300 Subject: [PATCH] Allow empty value for isPath validator Signed-off-by: Alex Andreev --- src/renderer/components/input/input.validators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/input/input.validators.ts b/src/renderer/components/input/input.validators.ts index 799a610824..4e18468da9 100644 --- a/src/renderer/components/input/input.validators.ts +++ b/src/renderer/components/input/input.validators.ts @@ -45,7 +45,7 @@ export const isUrl: Validator = { export const isPath: Validator = { condition: ({ type }) => type === "text", message: () => _i18n._(t`This field must be a path to an existing file`), - validate: value => fse.pathExistsSync(value), + validate: value => !value || fse.pathExistsSync(value), } export const minLength: Validator = {