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);