From 31221272e0bbea1e436699cd5d68f705f37d3361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Fri, 17 Feb 2023 07:56:30 +0100 Subject: [PATCH] Fix console error in examples pages du to no theme switcher (#38074) --- site/static/docs/5.3/assets/js/color-modes.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/static/docs/5.3/assets/js/color-modes.js b/site/static/docs/5.3/assets/js/color-modes.js index 68717f82d6..4528ba36b8 100644 --- a/site/static/docs/5.3/assets/js/color-modes.js +++ b/site/static/docs/5.3/assets/js/color-modes.js @@ -29,6 +29,11 @@ const showActiveTheme = (theme, focus = false) => { const themeSwitcher = document.querySelector('#bd-theme') + + if (!themeSwitcher) { + return + } + const themeSwitcherText = document.querySelector('#bd-theme-text') const activeThemeIcon = document.querySelector('.theme-icon-active use') const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)