DEV: Add falsy check for default value

This commit is contained in:
Gabriel Grubba 2024-12-19 18:31:00 -03:00
parent 4d32635c69
commit 74ccc12462
No known key found for this signature in database
GPG Key ID: 5FE41764F62D556C
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,10 @@ export default class BaseField extends Component {
constructor() {
super(...arguments);
if (this.args.field.extra?.default_value) {
if (
this.args.field.extra &&
Object.keys(this.args.field.extra).includes("default_value")
) {
this.args.field.metadata.value = this.args.field.extra.default_value;
}
}