1
0
Fork 0
mirror of synced 2024-06-29 03:20:34 +12:00

Merge pull request #6554 from Budibase/bug/sev3/blank-field-regex-not-working

Make null values empty for regex validation
This commit is contained in:
melohagan 2022-07-05 10:08:51 +01:00 committed by GitHub
commit ccb7f7c57b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -278,6 +278,9 @@ const notEqualHandler = (value, rule) => {
// Evaluates a regex constraint
const regexHandler = (value, rule) => {
const regex = parseType(rule.value, "string")
if (!value) {
value = ""
}
return new RegExp(regex).test(value)
}