Skip to content

Commit cc9ac77

Browse files
authoredJan 18, 2024
Merge pull request #14265 from rohanricky/pathRelativeToParent_null_check
null check
2 parents 2d68983 + 73bea51 commit cc9ac77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/types/ArraySubdocument.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) {
137137
*/
138138

139139
ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) {
140-
if (this.__index == null) {
140+
if (this.__index == null || (!this.__parentArray || !this.__parentArray.$path)) {
141141
return null;
142142
}
143143
if (skipIndex) {

0 commit comments

Comments
 (0)
Please sign in to comment.