Skip to content

Commit f0ee1d3

Browse files
Update lib/types/documentArray/index.js
Co-authored-by: Copilot <[email protected]>
1 parent 6757eb7 commit f0ee1d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/types/documentArray/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function MongooseDocumentArray(values, path, doc, schematype) {
9393
DocumentArrayMethods.set.call(proxy, prop, value, false);
9494
} else if (Object.hasOwn(internals, prop)) {
9595
internals[prop] = value;
96-
} else if (Object.hasOwn(schematype?.virtuals, prop)) {
96+
} else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) {
9797
schematype.virtuals[prop].applySetters(value, target);
9898
} else {
9999
__array[prop] = value;

0 commit comments

Comments
 (0)