From 79b6f7faafcdbf31bedd4fc68571792886bbc082 Mon Sep 17 00:00:00 2001 From: Rajesh-Nagarajan-11 Date: Thu, 24 Jul 2025 20:28:18 +0530 Subject: [PATCH] [Bug] Console Error in main page of website #6635 Signed-off-by: Rajesh-Nagarajan-11 --- onRenderBody.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/onRenderBody.js b/onRenderBody.js index a4c5f225a8186..7bd0c61242594 100644 --- a/onRenderBody.js +++ b/onRenderBody.js @@ -26,13 +26,14 @@ const MagicScriptTag = (props) => { } const root = document.documentElement; const iterate = (obj) => { - Object.keys(obj).forEach(key => { - if (typeof obj[key] === 'object') { - iterate(obj[key]) - } else { - root.style.setProperty("--" + key, obj[key]) - } - }) + if (!obj) return; + Object.keys(obj).forEach(key => { + if (typeof obj[key] === 'object') { + iterate(obj[key]) + } else { + root.style.setProperty("--" + key, obj[key]) + } + }) } const parsedTheme = JSON.parse('${JSON.stringify(props.theme)}') const theme = parsedTheme[colorMode]