Skip to content

Commit 6757eb7

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/types/array/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function MongooseArray(values, path, doc, schematype) {
9999
mongooseArrayMethods.set.call(proxy, prop, value, false);
100100
} else if (Object.hasOwn(internals, prop)) {
101101
internals[prop] = value;
102-
} else if (Object.hasOwn(schematype?.virtuals, prop)) {
102+
} else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) {
103103
schematype.virtuals[prop].applySetters(value, target);
104104
} else {
105105
__array[prop] = value;

0 commit comments

Comments
 (0)