Skip to content

Commit

Permalink
fix: 修复useValidator报错
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Aug 16, 2023
1 parent 13c9300 commit 4912f6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/web/useValidator.ts
Expand Up @@ -30,7 +30,7 @@ export const useValidator = () => {
const notSpace = (message?: string): FormItemRule => {
return {
validator: (_, val, callback) => {
if (val.indexOf(' ') !== -1) {
if (val?.indexOf(' ') !== -1) {
callback(new Error(message || t('common.notSpace')))
} else {
callback()
Expand Down

0 comments on commit 4912f6c

Please sign in to comment.