From 73bea51b3f306d1f4553bbb03864b8098aa02ea3 Mon Sep 17 00:00:00 2001 From: Rohan Kothapalli Date: Thu, 18 Jan 2024 17:19:25 +0530 Subject: [PATCH] null check --- lib/types/ArraySubdocument.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types/ArraySubdocument.js b/lib/types/ArraySubdocument.js index 55889caa839..af0bdd0d4a1 100644 --- a/lib/types/ArraySubdocument.js +++ b/lib/types/ArraySubdocument.js @@ -137,7 +137,7 @@ ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) { */ ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) { - if (this.__index == null) { + if (this.__index == null || (!this.__parentArray || !this.__parentArray.$path)) { return null; } if (skipIndex) {