Skip to content

fix: add null check for wikiMenu#7376

Merged
Eetwalt merged 1 commit intomainfrom
bugfix/add-check-wikimenu
Apr 13, 2026
Merged

fix: add null check for wikiMenu#7376
Eetwalt merged 1 commit intomainfrom
bugfix/add-check-wikimenu

Conversation

@liquidely
Copy link
Copy Markdown
Contributor

@liquidely liquidely commented Apr 9, 2026

Summary

To remove error in console on Lighthouse (Artifact). Because LH has it's own wikimenu.

Uncaught TypeError: can't access property "dataset", document.getElementById(...) is null

How did you test this change?

https://laura.wiki.tldev.eu/rocketleague/Main_Page

@liquidely liquidely requested review from a team as code owners April 9, 2026 12:38
Copilot AI review requested due to automatic review settings April 9, 2026 12:38
@liquidely liquidely added the javascript Changes to JavaScript files label Apr 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents a console error during Lighthouse runs by guarding access to the wiki menu element (ext-wikimenu) before reading its dataset attributes.

Changes:

  • Store #ext-wikimenu in a local variable and return early if it’s missing.
  • Read countOtherWikis from the cached element instead of calling getElementById inline.
  • Slightly adjust the conditional to avoid showing the badge unless the parsed count is a positive number.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Eetwalt Eetwalt merged commit aa85d25 into main Apr 13, 2026
11 checks passed
@Eetwalt Eetwalt deleted the bugfix/add-check-wikimenu branch April 13, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Changes to JavaScript files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants