From 69042b8ebeb8e720b15ad47b6270f65fa5080a61 Mon Sep 17 00:00:00 2001 From: pk Date: Tue, 30 Jul 2024 11:37:11 +0200 Subject: [PATCH] Catch empty data object in reach. --- reach.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reach.js b/reach.js index 3dc45c0..660bd6c 100644 --- a/reach.js +++ b/reach.js @@ -1,4 +1,6 @@ export const reach = (path, data) => { + if (!data) return; + const parts = path.split('.'); let part; while (part = parts.shift()) {