Skip to content

Commit 0601e7f

Browse files
committed
fixing issues with undefined fields
1 parent 0d8d41b commit 0601e7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/FormlyField.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
if ( this.field.required ){
4444
if ( !this.form.$errors[this.field.key].required ) this.$set(this.form.$errors[ this.field.key ], 'required', true);
4545
let requiredError = parseValidationString( 'required', false, label, this.model[ this.field.key ] );
46-
let requiredType = typeof this.model[ this.field.key ] === 'string' ? !this.model[ this.field.key ] : this.model[ this.field.key] !== null && this.model[ this.field.key ].length === 0;
46+
let requiredType = typeof this.model[ this.field.key ] === 'string' ? !this.model[ this.field.key ] : this.model[ this.field.key] !== null && this.model[this.field.key] !== undefined && this.model[ this.field.key ].length === 0;
4747
let required = this.display ? requiredType : false;
4848
setError(this.form, this.field.key, 'required', required, requiredError) ;
4949
}

0 commit comments

Comments
 (0)