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

fix: prevent TypeErrors in color-contrast checks #1320

Merged
merged 2 commits into from
Jan 17, 2019

Conversation

stephenmathieson
Copy link
Member

@stephenmathieson stephenmathieson commented Jan 16, 2019

This patch adds a safeguard to color.filteredRectStack which prevents a TypeError: Cannot read property '0' of undefined from being thrown.

This is not a perfect solution, but a stop-gap instead. It's still unclear why we're getting undefined here. More investigation is needed, but this can happen at a later date.

Closes #1306 and #1259.

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: @WilcoFiers

This patch adds a safeguard to `color.filteredRectStack` which prevents a `TypeError: Cannot read property '0' of undefined` from being thrown.

This is not a perfect solution, but a stop-gap instead. It's still unclear why we're getting `undefined` here. More investigation is needed, but this can happen at a later date.

Closes #1306 and #1259.
@stephenmathieson stephenmathieson requested a review from a team January 16, 2019 19:25
@stephenmathieson stephenmathieson requested a review from a team as a code owner January 16, 2019 19:25
Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

I'm okay with a stopgap solution, but we should leave one of those issues open so we have a reason to go back to it at some point.

@stephenmathieson
Copy link
Member Author

You're right. I'll make note of that and will keep one of the issues open.

@stephenmathieson stephenmathieson merged commit a34165c into develop Jan 17, 2019
@stephenmathieson stephenmathieson deleted the prevent-color-contrast-runtime-error branch January 17, 2019 15:02
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