From e182461a624bc6e13ecd23b03c4f9791e8675b4e Mon Sep 17 00:00:00 2001 From: Slava Leleka Date: Fri, 28 May 2021 14:40:56 +0300 Subject: [PATCH] return base if it's null without let nextBase --- src/helpers/get-property-in-chain.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/helpers/get-property-in-chain.js b/src/helpers/get-property-in-chain.js index 88123f6c..ffe90ef0 100644 --- a/src/helpers/get-property-in-chain.js +++ b/src/helpers/get-property-in-chain.js @@ -24,14 +24,13 @@ export function getPropertyInChain(base, chain) { const prop = chain.slice(0, pos); // https://github.com/AdguardTeam/Scriptlets/issues/128 - let nextBase = null; if (base === null) { // if base is null, return 'null' as base. // it's needed for triggering the reason logging while debugging - return { base: nextBase, prop, chain }; + return { base, prop, chain }; } - nextBase = base[prop]; + const nextBase = base[prop]; chain = chain.slice(pos + 1); if (nextBase !== undefined) { return getPropertyInChain(nextBase, chain);