Skip to content

Commit 341eb4a

Browse files
authored
fix: Validate Error when value undefined (#765)
Co-authored-by: 路振凯 <l>
1 parent f9ac280 commit 341eb4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/validateUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async function validateRule(
9090
}
9191
}
9292

93-
if (!result.length && subRuleField) {
93+
if (!result.length && subRuleField && Array.isArray(value) && value.length > 0) {
9494
const subResults: string[][] = await Promise.all(
9595
(value as StoreValue[]).map((subValue: StoreValue, i: number) =>
9696
validateRule(`${name}.${i}`, subValue, subRuleField, options, messageVariables),

0 commit comments

Comments
 (0)