Skip to content

Commit

Permalink
fix: handled validation of optional fields in case of null value
Browse files Browse the repository at this point in the history
  • Loading branch information
mamin-crest committed Apr 19, 2021
1 parent ea183b9 commit 18d0c35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/src/main/webapp/util/Validator.js
Expand Up @@ -182,6 +182,10 @@ class Validator {
}

for (i = 0; i < this.entities.length; i += 1) {
if (data[this.entities[i].field] === '' || data[this.entities[i].field] === null) {
// eslint-disable-next-line no-continue
continue;
}
if (this.entities[i].validators) {
for (j = 0; j < this.entities[i].validators.length; j += 1) {
switch (this.entities[i].validators[j].type) {
Expand Down

0 comments on commit 18d0c35

Please sign in to comment.