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 race condition when delay() is called after a timeout #74

Merged
merged 1 commit into from
Mar 2, 2019
Merged

Conversation

sth
Copy link
Contributor

@sth sth commented Mar 2, 2019

When the mouse leaves an active element element, delay() is called after a timeout. If during that time the node is removed with $(...).remove(), the node's data will be cleared by jquery and accessing $el.data('hoverIntent')[s.id] in delay() will fail with an error like this:

Uncaught TypeError: Cannot convert undefined or null to object

The error can be seen in the browser console when executing this fiddle: https://jsfiddle.net/t563wuve/

The solution is easy: Only delete the state if it's still there.

@usmonster
Copy link
Collaborator

Hi @sth! Good catch—your fix will be in the next patch version.

Thanks for your clear report and your contribution!

@usmonster usmonster merged commit d4de07b into briancherne:master Mar 2, 2019
@usmonster usmonster added this to the v1.10.1 milestone Mar 3, 2019
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