From 449da225695ce75f3e11cc4d7544165c8aa74cb3 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Mon, 4 Jan 2021 12:53:30 -0600 Subject: [PATCH] fix(core): check null and fail fast in getPathRecursive --- packages/core/src/lib/utils/get-path-recursive.util.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/lib/utils/get-path-recursive.util.ts b/packages/core/src/lib/utils/get-path-recursive.util.ts index deba9d6d1..84851bfeb 100644 --- a/packages/core/src/lib/utils/get-path-recursive.util.ts +++ b/packages/core/src/lib/utils/get-path-recursive.util.ts @@ -3,6 +3,10 @@ export function getPathRecursive( prefix = '', prev: string[] = [] ): string[] { + if (node == null) { + return; + } + const result = prev; const keys = Object.getOwnPropertyNames(node);