diff --git a/src/App.js b/src/App.js index f5b22393e..1529efbdd 100644 --- a/src/App.js +++ b/src/App.js @@ -23,7 +23,7 @@ const App = () => { useEffect(() => { const urlParams = new URLSearchParams(window.location.href.split('?')[1]) - const theme = urlParams.get('theme') && urlParams.get('theme').match(/^[A-Za-z0-9\s]+/)[0] + const theme = urlParams.get('theme')?.match(/^[A-Za-z0-9\s]+/)?.[0] if (theme) { setColorMode(theme) }