From 9ea22fc8928015b9bfea53e13cd1558b4aa812f9 Mon Sep 17 00:00:00 2001 From: rg755421 Date: Fri, 25 Sep 2026 13:57:08 +0545 Subject: [PATCH] Fix - navigation.js null errors on pages without the theme header (Widgets screen previews) Co-Authored-By: Claude Opus 5.5 --- js/navigation.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/navigation.js b/js/navigation.js index 254736d..293716d 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -71,6 +71,9 @@ ( function () { var container; container = document.getElementById( 'site-navigation' ); + if ( ! container ) { + return; + } /** * Toggles `focus` class to allow submenu access on tablets. @@ -180,7 +183,7 @@ } // Return if no excess menu items. - if ( ! navigation.classList.contains( 'tg-extra-menus' ) ) { + if ( ! navigation || ! navigation.classList.contains( 'tg-extra-menus' ) ) { return; }