Fix race condition on deleting clickedItem#483
Open
odinho wants to merge 1 commit intoisteven:masterfrom
Open
Conversation
If you have some code removing all items before the timeout is able to run, you'll get a nasty TypeError if you don't null check clickedItem.
Author
|
I saw a lot of this error when trying to make our selenium tests be free of console errors. The exception message in Opera and Chromium-based browsers is: |
Owner
|
@odinho , Thanks for the PR. Can you ensure that this breaks none of the existing functionalities? If all are OK, I'm going to merge it. |
Author
|
I never got to write full tests. But it did not break any of the internal tests for Hola when I worked there, and this patch was (and still is) used for all their web pages and control panels. So it has seen a lot of use. It shouldn't break something, but then maybe it will. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you have some code removing all items before the timeout is
able to run, you'll get a nasty TypeError if you don't null check
clickedItem.