diff --git a/src/app/AppLayout/AppLayout.tsx b/src/app/AppLayout/AppLayout.tsx index 90d4f7a7..b63a6228 100644 --- a/src/app/AppLayout/AppLayout.tsx +++ b/src/app/AppLayout/AppLayout.tsx @@ -35,7 +35,7 @@ const AppLayout: React.FunctionComponent = ({ children }) => { const toggleDarkTheme = (_evt, selected) => { const darkThemeToggleClicked = !selected === isDarkTheme - document.querySelector('html').classList.toggle('pf-v5-theme-dark', darkThemeToggleClicked); + document.querySelector('html')?.classList.toggle('pf-v5-theme-dark', darkThemeToggleClicked); setIsDarkTheme(darkThemeToggleClicked); };