Skip to content

Check that the Team page buttons exist before attaching handlers - #187

Closed
bendichter wants to merge 1 commit into
mainfrom
guard-team-page-handlers
Closed

bendichter wants to merge 1 commit into
mainfrom
guard-team-page-handlers

Conversation

@bendichter

Copy link
Copy Markdown
Contributor

Every page except Team logs TypeError: Cannot read properties of null (reading 'addEventListener') from main.js. The script attaches the "show more" and "show less" handlers unconditionally, and those buttons are only rendered on the Team page, and only for a group with more than eight members.

This wraps each pair of handlers in a check that the buttons exist. The error was at the end of the handler, so nothing else was being skipped. The diff is four added lines plus re-indentation, so it is easier to read with whitespace hidden.

🤖 Generated with Claude Code

main.js attached the "show more" and "show less" handlers without checking that the buttons exist. They are only rendered on the Team page, and only when a group has more than eight members, so the script threw a TypeError on every other page. Most of the diff is re-indentation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nwborg ready!

Name Link
🔨 Latest commit 0be0873
🔍 Latest deploy log https://app.netlify.com/projects/nwborg/deploys/6ac91bfe7741590008100a71
😎 Deploy Preview https://deploy-preview-187--nwborg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bendichter

Copy link
Copy Markdown
Contributor Author

Superseded by #206, which combines this with the related PRs. The commits here are included there unchanged.

@bendichter bendichter closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant