Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return early if tab or panel are undefined #99

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

camertron
Copy link
Contributor

@camertron camertron commented Jun 20, 2024

We tried to deploy the most recent release of tab-container-element to dotcom and ran into a TypeError: Cannot read properties of undefined (reading 'setAttribute') from this line. I don't understand how this happened, since we check to see if the index is out of bounds before trying to index into the tab or panel arrays. I added some early returns to prevent this error from happening again.

@camertron camertron requested a review from a team as a code owner June 20, 2024 21:09
@camertron camertron merged commit e0a9011 into main Jun 20, 2024
1 check passed
@camertron camertron deleted the early_return_if_undefined_tab branch June 20, 2024 21:11
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.

2 participants