From 0a828aae400c865f94cb9178d103b84e7c484489 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 22 Apr 2018 00:25:36 +0100 Subject: [PATCH] [firestore][js] fix issue with parent() incorrectly returning a 'parent' Path on a root level Path --- lib/modules/firestore/Path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/firestore/Path.js b/lib/modules/firestore/Path.js index 460c2763..c7fa414f 100644 --- a/lib/modules/firestore/Path.js +++ b/lib/modules/firestore/Path.js @@ -34,7 +34,7 @@ export default class Path { } parent(): Path | null { - return this._parts.length + return this._parts.length > 1 ? new Path(this._parts.slice(0, this._parts.length - 1)) : null; }