Skip to content

Add guard that checks if secondary nav is defined#2539

Merged
anselmbradford merged 1 commit intomainfrom
ans_sidebar_search
Apr 8, 2026
Merged

Add guard that checks if secondary nav is defined#2539
anselmbradford merged 1 commit intomainfrom
ans_sidebar_search

Conversation

@anselmbradford
Copy link
Copy Markdown
Member

The search page doesn't have the secondary nav, so throws the error Uncaught TypeError: Cannot read properties of null (reading 'setAttribute') in the dev console. This PR adds a guard to check if the secondary nav exists before trying to do scripting with it.

Changes

  • Add guard that checks if secondary nav is defined

Testing

  1. yarn build and start local server.
  2. See on search page that there is no dev console error.
  3. See on live search page that there is a dev console error.

Copy link
Copy Markdown
Collaborator

@itsmedavep itsmedavep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled the branch and tested this out. I do not see any errors in dev tools console.

Looks good to me. Approved!

@anselmbradford anselmbradford merged commit c431aeb into main Apr 8, 2026
3 of 4 checks passed
@anselmbradford anselmbradford deleted the ans_sidebar_search branch April 8, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants