From 14b668f54c326d4cc984fb6af85db82026727607 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 24 Oct 2017 18:13:34 +0200 Subject: [PATCH] Fix undefined current --- Utils/ArrayUtils.js | 4 ++++ Utils/oLib.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Utils/ArrayUtils.js b/Utils/ArrayUtils.js index 70dff9b..efb09e0 100644 --- a/Utils/ArrayUtils.js +++ b/Utils/ArrayUtils.js @@ -31,6 +31,10 @@ let current = data; for(let key in pathParts) { + if(current === null) { + return null; + } + current = current[key]; } diff --git a/Utils/oLib.js b/Utils/oLib.js index 8af71fa..12ffad0 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -31,6 +31,10 @@ let current = data; for(let key in pathParts) { + if(current === null) { + return null; + } + current = current[pathParts[key]]; }