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 "cannot read property '0' of undefined" in case of lost data race #8

Merged
merged 1 commit into from
Jun 16, 2019
Merged

Conversation

themasch
Copy link
Contributor

@themasch themasch commented Jun 6, 2019

We are using flickity together with another widget/ui framwork. This seems to cause some kind of data race where the navCompanion is not really "ready" when the first navCompanionSelect happens.
When this happes navCompanion.selectedCells is still undefined and accessing it throws an TypeError. This check prevents that. On our tests it behaves exactly the same as before, but without throwing the error.

We are using flickity together with another widget/ui framwork. This seems to cause some kind of data race where the navCompanion is not really "ready" when the first navCompanionSelect happens. 
When this happes `navCompanion.selectedCells` is still undefined and accessing it throws an TypeError. This check prevents that. On our tests it behaves exactly the same as before, but without throwing the error.
@desandro desandro merged commit 8466f05 into metafizzy:master Jun 16, 2019
@desandro
Copy link
Member

Thank you for this contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants