diff options
| author | XhmikosR <[email protected]> | 2023-03-14 20:30:11 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-14 20:30:11 +0200 |
| commit | 474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc (patch) | |
| tree | 614eeb858cdfeea2f4e7eaad365e6930a5209f33 /site | |
| parent | 6a043d95faf6c3dca040162538d4fc7bd643f9d8 (diff) | |
| download | bootstrap-474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc.tar.xz bootstrap-474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc.zip | |
Guard more in color-modes.js (#38235)
Diffstat (limited to 'site')
| -rw-r--r-- | site/static/docs/5.3/assets/js/color-modes.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 4528ba36b..541fcc21b 100644 --- a/site/static/docs/5.3/assets/js/color-modes.js +++ b/site/static/docs/5.3/assets/js/color-modes.js @@ -29,12 +29,12 @@ const showActiveTheme = (theme, focus = false) => { const themeSwitcher = document.querySelector('#bd-theme') + const themeSwitcherText = document.querySelector('#bd-theme-text') - if (!themeSwitcher) { + if (!themeSwitcher || !themeSwitcherText) { 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}"]`) const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href') |
