Skip to content

Commit 637b63e

Browse files
committed
null check
1 parent 6760c54 commit 637b63e

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)