diff --git a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js index 64b8269da..bf0056151 100644 --- a/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js +++ b/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js @@ -581,7 +581,9 @@ function fixMoreLinksInMobileSidebar() { const dropdown = document.querySelector( ".bd-sidebar-primary [id^=pst-nav-more-links]" ); - dropdown.classList.add("show"); + if (dropdown !== null) { + dropdown.classList.add("show"); + } } /*******************************************************************************