Skip to content

Commit 6d25679

Browse files
authored
Merge pull request #14172 from rohanricky/array_null_check
null check
2 parents 6760c54 + 637b63e commit 6d25679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ Document.prototype.$__set = function(pathToMark, path, options, constructing, pa
16891689
val[arrayAtomicsSymbol] = priorVal[arrayAtomicsSymbol];
16901690
val[arrayAtomicsBackupSymbol] = priorVal[arrayAtomicsBackupSymbol];
16911691
if (utils.isMongooseDocumentArray(val)) {
1692-
val.forEach(doc => { doc.isNew = false; });
1692+
val.forEach(doc => { doc && (doc.isNew = false); });
16931693
}
16941694
}
16951695

0 commit comments

Comments
 (0)