@@ -201,10 +201,14 @@
}
this.checks = checks;
ContentNode.getAncestors(this.parent.id).then(ancestors => {
+ if (!this.parent) {
+ // If the parent has been removed before the data is fetched, return
+ return;
+ }
for (const field of inheritableFields) {
if (
- this.parent.extra_fields.inherited_metadata &&
- this.parent.extra_fields.inherited_metadata[field]
+ this.parent.extra_fields?.inherited_metadata &&
+ !isUndefined(this.parent.extra_fields.inherited_metadata[field])
) {
this.checks[field] = this.parent.extra_fields.inherited_metadata[field];
}
@@ -291,6 +295,10 @@
}
this.closed = true;
},
+ handleCancel() {
+ this.closed = true;
+ this.$emit('inherit', {});
+ },
/**
* @public
*/