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

added an if statement to catch when we click the last cup to toggle it #25

Merged
merged 1 commit into from
Dec 12, 2020

Conversation

lexx54
Copy link
Contributor

@lexx54 lexx54 commented Dec 11, 2020

when you click on the last cup to fill it, it works fine, but when you click it again it throws:
Uncaught TypeError: Cannot read property 'classList' of null at highlightCups (script.js:13)
so I added an if statement at the beginning of the highlightCup function to prevent this from happening.
if (idx===7 && smallCups[idx].classList.contains("full")) idx--;

@bradtraversy bradtraversy merged commit f2462bb into bradtraversy:master Dec 12, 2020
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