From d752b2212e40889770a6862000449008e0060902 Mon Sep 17 00:00:00 2001 From: Janry Date: Mon, 11 Oct 2021 17:56:03 +0800 Subject: [PATCH] fix(schema): fix setValidateRule will throw error when use void field (#2281) --- packages/json-schema/src/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/json-schema/src/shared.ts b/packages/json-schema/src/shared.ts index 0d0e84965b5..9b580af0e71 100644 --- a/packages/json-schema/src/shared.ts +++ b/packages/json-schema/src/shared.ts @@ -198,7 +198,7 @@ export const patchStateFormSchema = ( } else { const isValidatorKey = SchemaValidatorMap[key] if (isValidatorKey) { - targetState['setValidatorRule'](key, compiled) + targetState['setValidatorRule']?.(key, compiled) } } })