From 8f4081357d7db310e05de28f0390ec71a62d2554 Mon Sep 17 00:00:00 2001 From: 1on Date: Fri, 30 Oct 2020 13:34:47 +0300 Subject: [PATCH] fix: Fixed setNested when removed field from array of fields --- src/utils/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/index.ts b/src/utils/index.ts index 0c36005..f300cad 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -52,6 +52,9 @@ export function setNested (obj: Record, field: string, value: any): subProxy = subProxy[matches[2]] } } else { + if (subProxy === undefined) { + break + } if (i === fieldParts.length - 1) { subProxy[fieldPart] = value break